--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -515,12 +515,31 @@
 		list (APPEND _includeDirs "${CMAKE_CURRENT_BINARY_DIR}")
 		list (APPEND _includeDirs "${CMAKE_CURRENT_SOURCE_DIR}")
 	endif()
-	# parse additional include directories from target compile flags
 	set (_targetFlags "")
 	cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
-	cotire_filter_compile_flags("${_language}" "I" _dirs _ignore ${_targetFlags})
-	if (_dirs)
-		list (APPEND _includeDirs ${_dirs})
+	# parse additional include directories from target compile flags
+	if (CMAKE_INCLUDE_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_dirs "")
+			cotire_filter_compile_flags("${_language}" "${_includeFlag}" _dirs _ignore ${_targetFlags})
+			if (_dirs)
+				list (APPEND _includeDirs ${_dirs})
+			endif()
+		endif()
+	endif()
+	# parse additional system include directories from target compile flags
+	if (CMAKE_INCLUDE_SYSTEM_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_dirs "")
+			cotire_filter_compile_flags("${_language}" "${_includeFlag}" _dirs _ignore ${_targetFlags})
+			if (_dirs)
+				list (APPEND _systemIncludeDirs ${_dirs})
+			endif()
+		endif()
 	endif()
 	# target include directories
 	get_directory_property(_dirs DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" INCLUDE_DIRECTORIES)


increase MSVC default PCH memory to 128M

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -3358,9 +3358,9 @@
 	endif()
 	if (MSVC)
 		# MSVC default PCH memory scaling factor of 100 percent (75 MB) is too small for template heavy C++ code
-		# use a bigger default factor of 140 percent (105 MB)
+		# use a bigger default factor of 170 percent (128 MB)
 		if (NOT DEFINED COTIRE_PCH_MEMORY_SCALING_FACTOR)
-			set (COTIRE_PCH_MEMORY_SCALING_FACTOR "140")
+			set (COTIRE_PCH_MEMORY_SCALING_FACTOR "170")
 		endif()
 	endif()
 	if (NOT COTIRE_UNITY_BUILD_TARGET_SUFFIX)


Enables embedding.

Enables embedding.

--- sqlxx-config.cmake
+++ sqlxx-config.cmake
@@ -29,17 +29,17 @@

 if(NOT DEFINED sqlxx_FOUND)

-#  # Locate library headers.
-#  find_path(sqlxx_include_dir
-#    NAMES sql.hpp
-#    PATHS ${sqlxx_DIR}/code
-#  )
+  # Locate library headers.
+  find_path(sqlxx_include_dir
+    NAMES sql.hpp
+    PATHS ${sqlxx_DIR}/code
+  )

-#  # Common name for exported library targets.
-#  set(sqlxx_libraries
-#    sqlxx odbc32.lib
-#    PARENT_SCOPE
-#  )
+  # Common name for exported library targets.
+  set(sqlxx_libraries
+    sqlxx
+    odbc32
+  )

   # Usual "required" et. al. directive logic.
   include(FindPackageHandleStandardArgs)


fix pkgconfig file for cross compiling

fix pkgconfig file for cross compiling

--- taglib.pc.cmake
+++ taglib.pc.cmake
@@ -7,5 +7,5 @@
 Description: Audio meta-data library
 Requires:
 Version: ${TAGLIB_LIB_VERSION_STRING}
-Libs: -L${LIB_INSTALL_DIR} -ltag
-Cflags: -I${INCLUDE_INSTALL_DIR}/taglib
+Libs: -L${dollar}{libdir} -ltag
+Cflags: -I${dollar}{includedir}/taglib


added the defines for PG to the config.h template

--- src/config.h.cmake
+++ src/config.h.cmake
@@ -28,6 +28,10 @@
 /* mySQL */
 #cmakedefine  HAVE_MYSQL_H
 #cmakedefine  HAVE_LIBMYSQL
+
+/* postgresql */
+#cmakedefine  HAVE_LIBPQ_FE_H
+#cmakedefine  HAVE_LIBPQ

 /* OpenSSL */
 #cmakedefine  HAVE_OPENSSL_SSL_H


removed variables TNUN_ALLOW_EXCEPTIONS, TNUN_ALLOW_RTTI and TNUN_NATIVE_OPTIMIZATION

Those compiler flags should be used by 3rd party projects as they wish.
We should not enforce global usage of those flags across all projects.

--- build_options.cmake
+++ build_options.cmake
@@ -64,41 +64,6 @@
     TNUN_add_compile_options( Release ${TNUN_compiler_debug_symbols} )
 endif()

-option( TNUN_ALLOW_EXCEPTIONS "Allow exception support in C++ code" true )
-option( TNUN_ALLOW_RTTI "Allow Runtime Type Information in C++ code" false )
-
-if( ${CMAKE_GENERATOR} MATCHES "Visual Studio" )
-    if( ${TNUN_ALLOW_EXCEPTIONS} )
-        add_compile_options( ${TNUN_compiler_exceptions_on} )
-    else()
-        add_compile_options( ${TNUN_compiler_exceptions_off} )
-    endif()
-
-    if( ${TNUN_ALLOW_RTTI} )
-        add_compile_options( ${TNUN_compiler_rtti_on} )
-    else()
-        add_compile_options( ${TNUN_compiler_rtti_off} )
-    endif()
-else()
-    if( ${TNUN_ALLOW_EXCEPTIONS} )
-        add_compile_options( $<$<COMPILE_LANGUAGE:CXX>:${TNUN_compiler_exceptions_on}> )
-    else()
-        add_compile_options( $<$<COMPILE_LANGUAGE:CXX>:${TNUN_compiler_exceptions_off}> )
-    endif()
-
-    if( ${TNUN_ALLOW_RTTI} )
-        add_compile_options( $<$<COMPILE_LANGUAGE:CXX>:${TNUN_compiler_rtti_on}> )
-    else()
-        add_compile_options( $<$<COMPILE_LANGUAGE:CXX>:${TNUN_compiler_rtti_off}> )
-    endif()
-endif()
-
-if( NOT ANDROID AND NOT iOS )
-    option( TNUN_NATIVE_CPU_OPTIMIZATION "Perform optimizations specific to host CPU" true )
-    if( ${TNUN_NATIVE_CPU_OPTIMIZATION} )
-        TNUN_add_compile_options( Release ${TNUN_native_optimization} )
-    endif()
-endif()

 ################################################################################
 #


cmake/compiler/clang: we can't include GccCompatible relatively

--- cmake/Compiler/Clang.cmake
+++ cmake/Compiler/Clang.cmake
@@ -1,3 +1,3 @@
-include(GccCompatible.cmake)
+include(${CMAKE_COMPILER_PATH}/GccCompatible.cmake)
 message(STATUS "-- using clang")
 set(CLANG TRUE)


handle x32/x64 for VS generators

handle x32/x64 for VS generators

--- cmake/Modules/CSProj.cmake
+++ cmake/Modules/CSProj.cmake
@@ -47,10 +47,18 @@
     # namespace is a magic number, UUIDv4.
     string(UUID CS_GUID NAMESPACE b3bedb1e-a742-4966-9f26-bd2c7ee949a2 NAME ${PROJECT_NAME} TYPE SHA1 UPPER)
   endif()
-  if (NOT DEFINED CS_PLATFORM)
-    # Use native platform if none specified.
-    math(EXPR CS_PLATFORM 8*${CMAKE_SIZEOF_VOID_P})
-    set(CS_PLATFORM "x${CS_PLATFORM}")
+  if (NOT DEFINED CS_PLATFORM OR "${CS_PLATFORM}" STREQUAL "")
+    if (CMAKE_GENERATOR MATCHES "^Visual Studio")
+      if (CMAKE_GENERATOR MATCHES "Win64$")
+        set(PLATFORM x64)
+      else()
+        set(PLATFORM x32)
+      endif()
+    else()
+      # Use native platform if none specified.
+      math(EXPR CS_PLATFORM 8*${CMAKE_SIZEOF_VOID_P})
+      set(CS_PLATFORM "x${CS_PLATFORM}")
+    endif()
   endif()

   set(CS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")


detect AppleClang

detect AppleClang

--- cmake/TaichiCXXFlags.cmake
+++ cmake/TaichiCXXFlags.cmake
@@ -42,7 +42,7 @@
     set(CMAKE_CXX_FLAGS
             "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /std:c++14 /MP /Z7 /D \"_CRT_SECURE_NO_WARNINGS\" /D \"_ENABLE_EXTENDED_ALIGNED_STORAGE\" /arch:AVX2 -DGL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED")
 else()
-    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
         message("Clang compiler detected. Using std=c++17.")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
     else()


fix warning in case devel space is nested in the build space

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -411,7 +411,7 @@
     string_starts_with("${idir}/" "${CATKIN_DEVEL_PREFIX}/" _is_devel_prefix)
     if(_is_source_prefix OR _is_build_prefix OR _is_devel_prefix)
       # generated header files should be places in the devel space rather then in the build space
-      if(_is_build_prefix)
+      if(_is_build_prefix AND NOT _is_devel_prefix)
         message(WARNING "catkin_package() include dir '${idir}' should be placed in the devel space instead of the build space")
       endif()
       # the value doesn't matter as long as it doesn't match IS_ABSOLUTE


Use PROJECTS_DIR variable

Use PROJECTS_DIR variable

--- cmake/eacirc_project.cmake
+++ cmake/eacirc_project.cmake
@@ -27,6 +27,6 @@
     option(BUILD_${UPPERCASE_NAME} "Build project ${NAME}" ON)

     if(BUILD_${UPPERCASE_NAME})
-        add_subdirectory(${PROJECT_SOURCE_DIR}/projects/${NAME})
+        add_subdirectory(${PROJECTS_DIR}/${NAME})
     endif()
 endfunction()


cmake: add create_symlink macro to toolbox

--- cmake/toolbox/macros.cmake
+++ cmake/toolbox/macros.cmake
@@ -100,3 +100,14 @@
 		message(STATUS "${_variableName} = ${${_variableName}}")
 	endforeach()
 endmacro(display_all_variables)
+
+# create symlink if file does not already exist
+#
+# CALL: create_symlink(SOURCE TARGET)
+#	SOURCE: source file/dir
+#	TARGET: target file/dir
+macro(create_symlink SOURCE TARGET)
+	if(NOT EXISTS ${TARGET})
+		execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SOURCE} ${TARGET})
+	endif()
+endmacro(create_symlink)


Re-enter valgrind args that were removed by accident

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -141,7 +141,7 @@
   "-DMESHES=/lore/diamog/cdash/repos/EnGPar/pumi-meshes/"
   "-DGRAPHS=/lore/diamog/cdash/repos/EnGPar/EnGPar-graphs/"
   "-DVALGRIND=valgrind"
-  "-DVALGRIND_ARGS=--suppressions=/lore/diamog/cdash/repos/EnGPar/mpich3.supp"
+  "-DVALGRIND_ARGS=--log-file=vg.%p;--leak-check=full;--error-exitcode=1;--suppressions=/lore/diamog/cdash/repos/EnGPar/mpich3.supp"
   )
 message(STATUS "configure options ${CONFIGURE_VALGRIND}")
 build_subproject(memcheck "${CONFIGURE_VALGRIND}")


reuse common nightly config options

reuse common nightly config options

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -296,13 +296,7 @@
 )

 SET(CONFIGURE_OPTIONS-sim
-  "-DCMAKE_C_COMPILER:FILEPATH=mpicc"
-  "-DCMAKE_CXX_COMPILER:FILEPATH=mpicxx"
-  "-DCMAKE_C_FLAGS:STRING=-O2 -g -Wall -Wextra"
-  "-DCMAKE_CXX_FLAGS:STRING=-O2 -g -Wall -Wextra"
-  "-DENABLE_ZOLTAN:BOOL=ON"
-  "-DPCU_COMPRESS:BOOL=ON"
-  "-DIS_TESTING:BOOL=True"
+  "${CONFIGURE_OPTIONS}"
   "-DSIM_PARASOLID:BOOL=ON"
   "-DSIM_MPI:STRING=mpich3.1.2"
 )


surfaceless: Remove false dependencies on gbm, libkms, libdrm.

Our code doesn't directly use any of those, they're just internal
dependencies of the surfaceless platform.  Avoids Mesa CI's CTS build
requiring an installed Mesa already.

Change-Id: I573939d3f4be307232f559da0cda8bc9c0999314

--- targets/surfaceless/surfaceless.cmake
+++ targets/surfaceless/surfaceless.cmake
@@ -34,10 +34,6 @@
 pkg_check_modules(EGL REQUIRED egl)
 set(DEQP_EGL_LIBRARIES ${EGL_LIBRARIES})

-pkg_check_modules(GBM REQUIRED gbm)
-pkg_check_modules(KMS REQUIRED libkms)
-pkg_check_modules(DRM REQUIRED libdrm)
-
 include_directories(${GLES2_INCLUDE_PATH} ${GLES3_INCLUDE_PATH}
                     ${EGL_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS}
                     ${KMS_INCLUDE_DIRS} ${DRM_INCLUDE_DIRS})


fixed escaping of git commit message

fixed escaping of git commit message

--- src/mirrage/core/version_info.cmake
+++ src/mirrage/core/version_info.cmake
@@ -26,5 +26,5 @@
   ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

 # generate info.cpp
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/info.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/info.cpp" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/info.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/info.cpp" ESCAPE_QUOTES @ONLY)


cmake: support global launcher properties on MIC builds

query the global RULE_LAUNCH_COMPILE and RULE_LAUNCH_LINK properties and
prepend them to the compile/link commands for the MIC

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

--- cmake/FindMIC.cmake
+++ cmake/FindMIC.cmake
@@ -203,8 +203,9 @@
          list(APPEND _flags "-I${_i}")
       endforeach()

+      get_property(_launch_rule GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
       add_custom_command(OUTPUT "${${_output}}"
-         COMMAND "${_compiler}" -mmic
+         COMMAND ${_launch_rule} "${_compiler}" -mmic
          -DVc_IMPL=MIC
          ${_flags} -c -o "${${_output}}" "${_abs}"
          DEPENDS "${_abs}" ${_deps}
@@ -355,8 +356,9 @@
       endforeach()

       set(_exec_output "${CMAKE_CURRENT_BINARY_DIR}/${_exec_output_name}")
+      get_property(_launch_rule GLOBAL PROPERTY RULE_LAUNCH_LINK)
       add_custom_command(OUTPUT "${_exec_output}"
-         COMMAND "${MIC_CXX}" -mmic
+         COMMAND ${_launch_rule} "${MIC_CXX}" -mmic
          "-L${MIC_SDK_DIR}/compiler/lib/mic/"
          ${_mic_lflags} ${_objects} -o "${_exec_output}"
          ${_libs}


Fixed bugs in FindZMQ.cmake

Fixed bugs in FindZMQ.cmake

--- cmake/FindZMQ.cmake
+++ cmake/FindZMQ.cmake
@@ -27,7 +27,7 @@
 # Generates a HINTS directive for a find_XXX command, based on
 # a known file path.
 function (_getHintsDirective targetVarName knownPath)
-    if (existingPath)
+    if (knownPath)
         get_filename_component (d "${knownPath}" DIRECTORY)
         set (${targetVarName} "HINTS" "${d}/.." PARENT_SCOPE)
     else ()
@@ -157,7 +157,7 @@
         PATH_SUFFIXES "lib")
     _getHintsDirective(hints ${ZMQ_LIBRARY})
     find_path (ZMQ_HEADER_DIR "zmq.h"
-        ${_hints}
+        ${hints}
         PATHS $ENV{ZMQ_DIR}
         PATH_SUFFIXES "include")
     set (${library} "${ZMQ_LIBRARY}" PARENT_SCOPE)


Fix cmake install on iOS

Fix cmake install on iOS

Fixes:
INSTALL TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable

--- cmake/install.cmake
+++ cmake/install.cmake
@@ -30,7 +30,9 @@

 if (protobuf_BUILD_PROTOC_BINARIES)
   install(TARGETS protoc EXPORT protobuf-targets
-    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+    BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
+    COMPONENT protoc)
   if (UNIX AND NOT APPLE)
     set_property(TARGET protoc
       PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")


[cmake] separation of docker workdirs

[cmake] separation of docker workdirs

--- cmake/Docker.cmake
+++ cmake/Docker.cmake
@@ -71,7 +71,7 @@
   file(APPEND ${GENERATED_DOCKER_FILE} "RUN mkdir -p /usr/local\n")

   if(NOT DOCKER_WORKDIR)
-    set(DOCKER_WORKDIR /workdir)
+    set(DOCKER_WORKDIR ${CMAKE_SOURCE_DIR}/docker-workdir)
   endif()

   set(DOCKER_WORKDIR_VOLUME "workdir-${DOCKER_IMAGE_AS_DIR}")


Fix a race condition in build.

Fix a race condition in build.

Fix a race condition between build of bundled luajit and build of
tarantool_lua_info.h.

(Failure to build tarantool_lua_info.m on Debian SID).

--- cmake/luajit.cmake
+++ cmake/luajit.cmake
@@ -36,7 +36,7 @@

 macro (luajit_use_bundled)
     set (LUAJIT_PREFIX "${LUAJIT_BUNDLED_PREFIX}")
-    set (LUAJIT_INCLUDE "${LUAJIT_BUNDLED_PREFIX}")
+    set (LUAJIT_INCLUDE "${PROJECT_SOURCE_DIR}/third_party/luajit/src")
     set (LUAJIT_LIB "${LUAJIT_BUNDLED_LIB}")
     set (ENABLE_BUNDLED_LUAJIT True)
 endmacro()


Fix mkldnn cmake.

Fix mkldnn cmake.

--- cmake/mkldnn.cmake
+++ cmake/mkldnn.cmake
@@ -3,7 +3,7 @@
     find_path(MKLDNN_INCLUDE_DIR mkldnn.h)
     find_library(MKLDNN_LIB mkldnn)

-    if(NOT ${MKLDNN_INCLUDE_DIR} AND NOT ${MKLDNN_LIB})
+    if(MKLDNN_INCLUDE_DIR AND MKLDNN_LIB)
         set(MKLDNN_FOUND TRUE)
     endif()


Set SWIGWORDSIZE dependent on architecture bitness (#3313)

* Set SWIGWORDSIZE dependent on architecture bitness

Setting SWIGWORDSIZE to 64bit on 32bit archs breaks build on
32 bit archs, e.g. i586 or armv7.

See #3271.

Co-authored-by: Red Daly <ba613d7355627d46239437514216030190cd2d72@gmail.com>

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -19,7 +19,11 @@
 endif()

 if(UNIX AND NOT APPLE)
-  list(APPEND CMAKE_SWIG_FLAGS "-DSWIGWORDSIZE64")
+  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+    list(APPEND CMAKE_SWIG_FLAGS "-DSWIGWORDSIZE64")
+  else()
+    list(APPEND CMAKE_SWIG_FLAGS "-DSWIGWORDSIZE32")
+  endif()
 endif()

 # Find Python 3


Added experimental MACOSX build target

Added experimental MACOSX build target

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -65,6 +65,7 @@
 #    WATCHOS = Build for armv7k arm64_32 for watchOS.
 #    WATCHOSCOMBINED = Build for armv7k arm64_32 x86_64 watchOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY)
 #    SIMULATOR_WATCHOS = Build for x86_64 for watchOS Simulator.
+#    MACOSX = Build for x86_64 macOS.
 #
 # CMAKE_OSX_SYSROOT: Path to the SDK to use.  By default this is
 #    automatically determined from PLATFORM and xcodebuild, but
@@ -96,6 +97,7 @@
 #    SIMULATOR_TVOS = x86_64 (i386 has since long been deprecated)
 #    WATCHOS = armv7k arm64_32 (if applicable)
 #    SIMULATOR_WATCHOS = x86_64 (i386 has since long been deprecated)
+#    MACOSX = x86_64
 #
 # This toolchain defines the following variables for use externally:
 #
@@ -211,6 +213,8 @@
       set(PLATFORM "WATCHOS")
     elseif(CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_SYSROOT MATCHES ".*watchsimulator.*")
       set(PLATFORM "SIMULATOR_WATCHOS")
+    elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" AND CMAKE_OSX_SYSROOT MATCHES ".*macos.*")
+      set(PLATFORM "MACOS")
     endif()
   endif()
   if (NOT PLATFORM)
@@ -338,6 +342,12 @@
     set(ARCHS i386)
     set(APPLE_TARGET_TRIPLE_INT i386-apple-watchos)
   endif()
+elseif(PLATFORM_INT STREQUAL "MACOSX")
+  set(SDK_NAME macosx)
+  if(NOT ARCHS)
+    set(ARCHS x86_64)
+    set(APPLE_TARGET_TRIPLE_INT x86_64-apple-macosx)
+  endif()
 else()
   message(FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}")
 endif()
@@ -345,6 +355,8 @@
 if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode")
   message(FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode")
 endif()
+
+message(STATUS "Chosen SDK name: ${SDK_NAME}")

 # If user did not specify the SDK root to use, then query xcodebuild for it.
 execute_process(COMMAND xcodebuild -version -sdk ${SDK_NAME} Path
@@ -363,19 +375,23 @@
 endif()

 # Set Xcode property for SDKROOT as well if Xcode generator is used
-if(USED_CMAKE_GENERATOR MATCHES "Xcode")
-  set(CMAKE_OSX_SYSROOT "${SDK_NAME}" CACHE INTERNAL "")
-endif()
+#if(USED_CMAKE_GENERATOR MATCHES "Xcode")
+#  set(CMAKE_OSX_SYSROOT "${SDK_NAME}" CACHE INTERNAL "")
+#endif()

 # Specify minimum version of deployment target.
 if(NOT DEFINED DEPLOYMENT_TARGET)
   if (PLATFORM_INT STREQUAL "WATCHOS" OR PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
-    # Unless specified, SDK version 2.0 is used by default as minimum target version (watchOS).
-    set(DEPLOYMENT_TARGET "2.0"
+    # Unless specified, SDK version 4.0 is used by default as minimum target version (watchOS).
+    set(DEPLOYMENT_TARGET "4.0"
             CACHE STRING "Minimum SDK version to build for." )
-  else()
-    # Unless specified, SDK version 9.0 is used by default as minimum target version (iOS, tvOS).
-    set(DEPLOYMENT_TARGET "9.0"
+  elseif(PLATFORM_INT STREQUAL "MACOSX")
+    # Unless specified, SDK version 10.13 (High sierra) is used by default as minimum target version (macosx).
+    set(DEPLOYMENT_TARGET "10.13"
+        CACHE STRING "Minimum SDK version to build for." )
+  else()
+    # Unless specified, SDK version 11.0 is used by default as minimum target version (iOS, tvOS).
+    set(DEPLOYMENT_TARGET "11.0"
             CACHE STRING "Minimum SDK version to build for." )
   endif()
   message(STATUS "Using the default min-version since DEPLOYMENT_TARGET not provided!")
@@ -466,13 +482,15 @@
       OUTPUT_STRIP_TRAILING_WHITESPACE)
   set(CMAKE_INSTALL_NAME_TOOL ${CMAKE_INSTALL_NAME_TOOL_INT} CACHE STRING "" ${FORCE_CACHE})
 endif()
-# Get the version of Darwin (OS X) of the host.
+# Get the version of Darwin (macosx) of the host.
 execute_process(COMMAND uname -r
   OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
 if(SDK_NAME MATCHES "iphone")
   set(CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE})
+elseif(SDK_NAME MATCHES "macosx")
+  set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" ${FORCE_CACHE})
 endif()
 # CMake 3.14+ support building for iOS, watchOS and tvOS out of the box.
 if(MODERN_CMAKE)
@@ -487,10 +505,10 @@
     set(CMAKE_IOS_INSTALL_COMBINED YES CACHE INTERNAL "" ${FORCE_CACHE})
     message(STATUS "Will combine built (static) artifacts into FAT lib...")
   endif()
-elseif(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10")
+elseif(NOT DEFINED CMAKE_SYSTEM_NAME AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10")
   # Legacy code path prior to CMake 3.14 or fallback if no SDK_NAME specified
   set(CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE})
-else()
+elseif(NOT DEFINED CMAKE_SYSTEM_NAME)
   # Legacy code path prior to CMake 3.14 or fallback if no SDK_NAME specified
   set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" ${FORCE_CACHE})
 endif()
@@ -503,7 +521,7 @@
 set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
 set(CMAKE_STRIP strip CACHE FILEPATH "" FORCE)
 # Set the architectures for which to build.
-set(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE STRING "Build architecture for iOS")
+set(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE STRING "Build architecture")
 # Change the type of target generated for try_compile() so it'll work when cross-compiling, weak compiler checks
 if(ENABLE_STRICT_TRY_COMPILE_INT)
   message(STATUS "Using strict compiler checks (default in CMake).")
@@ -567,6 +585,9 @@
   elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
     set(SDK_NAME_VERSION_FLAGS
       "-mwatchos-simulator-version-min=${DEPLOYMENT_TARGET}")
+  elseif(PLATFORM_INT STREQUAL "MACOSX")
+    set(SDK_NAME_VERSION_FLAGS
+        "-mmacosx-version-min=${DEPLOYMENT_TARGET}")
   else()
     # SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min.
     set(SDK_NAME_VERSION_FLAGS


Replace AWS_EVENT_STREAM_SHA with AWS_EVENT_STREAM_TAG

--- third-party/cmake/BuildAwsEventStream.cmake
+++ third-party/cmake/BuildAwsEventStream.cmake
@@ -5,7 +5,7 @@
     ExternalProject_Add(AwsCEventStream
         PREFIX ${AWS_DEPS_BUILD_DIR}
         GIT_REPOSITORY ${AWS_EVENT_STREAM_URL}
-        GIT_TAG ${AWS_EVENT_STREAM_SHA}
+        GIT_TAG ${AWS_EVENT_STREAM_TAG}
         BUILD_IN_SOURCE 0
         UPDATE_COMMAND ""
         CMAKE_ARGS
@@ -27,7 +27,7 @@
     ExternalProject_Add(AwsCEventStream
         PREFIX ${AWS_DEPS_BUILD_DIR}
         GIT_REPOSITORY ${AWS_EVENT_STREAM_URL}
-        GIT_TAG ${AWS_EVENT_STREAM_SHA}
+        GIT_TAG ${AWS_EVENT_STREAM_TAG}
         BUILD_IN_SOURCE 0
         UPDATE_COMMAND ""
         CMAKE_ARGS
@@ -46,7 +46,7 @@
     ExternalProject_Add(AwsCEventStream
         PREFIX ${AWS_DEPS_BUILD_DIR}
         GIT_REPOSITORY ${AWS_EVENT_STREAM_URL}
-        GIT_TAG ${AWS_EVENT_STREAM_SHA}
+        GIT_TAG ${AWS_EVENT_STREAM_TAG}
         BUILD_IN_SOURCE 0
         UPDATE_COMMAND ""
         CMAKE_ARGS


Attempts to fix a bug on Brett's build.

Attempts to fix a bug on Brett's build.

--- CMake/FindCEGUI.cmake
+++ CMake/FindCEGUI.cmake
@@ -47,6 +47,7 @@
         /usr/local/lib
         /usr/lib
         /usr/lib/CEGUI
+        /usr/local/lib/CEGUI
         /usr/lib/cegui-0.7.1
         /sw/lib
         /opt/local/lib
@@ -93,6 +94,7 @@
   /usr/local/include
   /usr/local/include/CEGUI
   /usr/include
+  /usr/include/CEGUI
   /sw/include
   /opt/local/include
   /opt/csw/include


debug and optimized flag work only on one lib

--- CMake/FindDCMTK.cmake
+++ CMake/FindDCMTK.cmake
@@ -63,28 +63,50 @@
     oflog
     ofstd)

+  # Find Release libraries
   find_library(DCMTK_${lib}_LIBRARY
     ${lib}
     PATHS
     ${DCMTK_DIR}/${lib}/libsrc
     ${DCMTK_DIR}/${lib}/libsrc/Release
-    ${DCMTK_DIR}/${lib}/libsrc/Debug
     ${DCMTK_DIR}/${lib}/Release
-    ${DCMTK_DIR}/${lib}/Debug
     ${DCMTK_DIR}/lib
+    ${DCMTK_DIR}/lib/Release
+    ${DCMTK_DIR}/dcmjpeg/lib${lib}/Release
     NO_DEFAULT_PATH
     )
-
+
   mark_as_advanced(DCMTK_${lib}_LIBRARY)

   #message("** DCMTKs ${lib} found at ${DCMTK_${lib}_LIBRARY}")

   if(DCMTK_${lib}_LIBRARY)
-    list(APPEND DCMTK_LIBRARIES ${DCMTK_${lib}_LIBRARY})
+    list(APPEND DCMTK_LIBRARIES_RELEASE optimized ${DCMTK_${lib}_LIBRARY})
+  endif()
+
+  # Find Debug libraries
+  find_library(DCMTK_${lib}_LIBRARY_DEBUG
+    ${lib}
+    PATHS
+    ${DCMTK_DIR}/${lib}/libsrc
+    ${DCMTK_DIR}/${lib}/libsrc/Debug
+    ${DCMTK_DIR}/${lib}/Debug
+    ${DCMTK_DIR}/lib
+    ${DCMTK_DIR}/lib/Debug
+    ${DCMTK_DIR}/dcmjpeg/lib${lib}/Debug
+    NO_DEFAULT_PATH
+    )
+
+  mark_as_advanced(DCMTK_${lib}_LIBRARY_DEBUG)
+
+  if(DCMTK_${lib}_LIBRARY_DEBUG)
+    list(APPEND DCMTK_LIBRARIES_DEBUG debug ${DCMTK_${lib}_LIBRARY_DEBUG})
   endif()

 endforeach()

+#depending on build type set debug or release
+list(APPEND DCMTK_LIBRARIES ${DCMTK_LIBRARIES_RELEASE} ${DCMTK_LIBRARIES_DEBUG} )

 set(DCMTK_config_TEST_HEADER osconfig.h)
 set(DCMTK_dcmdata_TEST_HEADER dctypes.h)


COMP: warn users about openmp usage in shark+otb

--- CMake/FindShark.cmake
+++ CMake/FindShark.cmake
@@ -104,15 +104,10 @@
   "#define.SHARK_USE_OPENMP"
   SHARK_USE_OPENMP_matched "${SHARK_H_CONTENTS}")

-
-set(SHARK_USE_OPENMP FALSE CACHE BOOL "shark is built with OpenMP")
 if(SHARK_USE_OPENMP_matched)
-  #TODO: remove the previous set(SHARK_USE_OPENMP..
-  # and force OTB_USE_OPENMP
-  set(SHARK_USE_OPENMP TRUE CACHE BOOL "shark is built with OpenMP" FORCE)
-  message(STATUS "Shark is built with OpenMP: SHARK_USE_OPENMP = TRUE")
-else()
-  message(STATUS "Shark is built without OpenMP: SHARK_USE_OPENMP = FALSE")
+  if(NOT OTB_USE_OPENMP)
+    message(WARNING "Shark library is built with OpenMP and you have OTB_USE_OPENMP set to OFF.")
+  endif()
 endif()

 INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)


Support for GCC < 4.9 and Clang < 3.5

Support for GCC < 4.9 and Clang < 3.5

--- CMake/Utilities.cmake
+++ CMake/Utilities.cmake
@@ -67,7 +67,13 @@
 # Enable C++14
 macro(enable_cpp14 TARGET)
     if(UNIX)
-        target_compile_options(${TARGET} PUBLIC -std=c++14)
+        if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
+            target_compile_options(${TARGET} PUBLIC -std=c++1y)
+        elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
+            target_compile_options(${TARGET} PUBLIC -std=c++1y)
+        else()
+            target_compile_options(${TARGET} PUBLIC -std=c++14)
+        endif()
         util_enable_libcpp(${TARGET})
     endif()
 endmacro()


cmake: Check for libutil.h on FreeBSD.

cmake: Check for libutil.h on FreeBSD.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -51,6 +51,7 @@
 check_include_file(termios.h HAVE_TERMIOS_H)
 check_include_file(unistd.h HAVE_UNISTD_H)
 check_include_file(util.h HAVE_UTIL_H)
+check_include_file(libutil.h HAVE_LIBUTIL_H)

 if (WIN32)
   check_include_files("winsock2.h;ws2tcpip.h;wspiapi.h" HAVE_WSPIAPI_H)


Fixing conflict with recent changes.

Fixing conflict with recent changes.

--- cmake/dtkPack.cmake
+++ cmake/dtkPack.cmake
@@ -4,9 +4,9 @@
 ## Copyright (C) 2008 - Julien Wintz, Inria.
 ## Created: Fri Apr  2 09:04:36 2010 (+0200)
 ## Version: $Id$
-## Last-Updated: Thu Jun 10 10:41:48 2010 (+0200)
+## Last-Updated: Wed Sep 22 16:39:32 2010 (+0200)
 ##           By: Julien Wintz
-##     Update #: 43
+##     Update #: 45
 ######################################################################
 ##
 ### Commentary:
@@ -23,28 +23,25 @@
 ## Global settings
 ## #################################################################

-if(NOT DTK_AGGREGATE_PLUGINS)
-  set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
-  if( "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" )
-    # To obtain rpm named such as dtk-...-.fc10.x86_64.rpm
-    execute_process( COMMAND uname -r
-                     COMMAND sed "s/.*\\.\\(\\w*\\.\\w*\\)$/\\1/"
-                     OUTPUT_VARIABLE PACKAGE_EXTENSION
-                     OUTPUT_STRIP_TRAILING_WHITESPACE)
-    set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}.${PACKAGE_EXTENSION}")
-  else( "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" )
-    # Default situation
-    set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
-  endif( "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" )
+set(CPACK_PACKAGE_NAME ${PROJECT_NAME})

-  set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}-src")
-  set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_NAME})
-  set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_NAME})
-endif(NOT DTK_AGGREGATE_PLUGINS)
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+  execute_process(COMMAND uname -r
+    COMMAND sed "s/.*\\.\\(\\w*\\.\\w*\\)$/\\1/"
+    OUTPUT_VARIABLE PACKAGE_EXTENSION
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}.${PACKAGE_EXTENSION}")
+else("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+  set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
+endif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}-src")

 set(CPACK_PACKAGE_VENDOR "http://www.inria.fr/sophia/dream")
 set(CPACK_PACKAGE_CONTACT "Julien Wintz <jwintz@sophia.inria.fr>")
 set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README.txt)
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_NAME})
+set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_NAME})
 set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})
 set(CPACK_PACKAGE_VERSION_MINOR ${${PROJECT_NAME}_VERSION_MINOR})
 set(CPACK_PACKAGE_VERSION_PATCH ${${PROJECT_NAME}_VERSION_BUILD})


geoclaw off by default

geoclaw off by default

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -1,6 +1,6 @@
 option(mpi "use MPI library" on)

-option(geoclaw "build Geoclaw" on)
+option(geoclaw "build Geoclaw")

 option(p4est_external "force build of p4est")
 option(sc_external "force build of libsc")


Support building with UBSan (-fsanitize=undefined)

--- build_settings.cmake
+++ build_settings.cmake
@@ -4,7 +4,7 @@
 include(${CMAKE_CURRENT_LIST_DIR}/vtag.cmake)

 if (VESPA_USE_SANITIZER)
-    if (VESPA_USE_SANITIZER STREQUAL "address" OR VESPA_USE_SANITIZER STREQUAL "thread")
+    if (VESPA_USE_SANITIZER STREQUAL "address" OR VESPA_USE_SANITIZER STREQUAL "thread" OR VESPA_USE_SANITIZER STREQUAL "undefined")
         message("-- Instrumenting code using ${VESPA_USE_SANITIZER} sanitizer")
     else()
         message(FATAL_ERROR "Unsupported sanitizer option '${VESPA_USE_SANITIZER}'. Supported: 'address' or 'thread'")


Link glog and cflags regardless of debug/release

Former-commit-id: 8abfe3e05f8ca4fb2b8fa77883cc7e36bedcdef9

--- cmake-modules/Fetch_Ceres.cmake
+++ cmake-modules/Fetch_Ceres.cmake
@@ -12,9 +12,7 @@
     target_include_directories(ceres INTERFACE ${CERES_INCLUDE_DIR})
     remove_shared(ceres)
     remove_pthread(ceres)
-    if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
-        target_link_libraries(ceres INTERFACE Eigen3::Eigen glog::glog gflags -lpthread)
-    endif()
+    target_link_libraries(ceres INTERFACE Eigen3::Eigen glog::glog gflags)
 else()

@@ -71,9 +69,7 @@
         target_include_directories(ceres INTERFACE ${CERES_INCLUDE_DIR})
         remove_shared(ceres)
         remove_pthread(ceres)
-        if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
-            target_link_libraries(ceres INTERFACE Eigen3::Eigen glog::glog gflags -lpthread)
-        endif()
+        target_link_libraries(ceres INTERFACE Eigen3::Eigen glog::glog gflags -lpthread)
     else()
         message(STATUS "config_result: ${config_result}")
         message(STATUS "build_result: ${build_result}")


Removed FindOpenSSL in favour of cmake supplied module.

--- cmake/Modules/FindOpenSSL.cmake
+++ cmake/Modules/FindOpenSSL.cmake
@@ -1,62 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-
-
-# - Try to find OpenSSL
-# Once done this will define
-#  OPENSSL_FOUND - System has OpenSSL
-#  OPENSSL_INCLUDE_DIRS - The OpenSSL include directories
-#  OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
-#  OpenSSL::lib - Imported target for OpenSSL
-
-find_path(OPENSSL_INCLUDE_DIR ssl.h crypto.h
-          /usr/include/openssl
-          /usr/local/include/openssl
-          /usr/local/opt/openssl/include/openssl
-          ${OPENSSL_DIR}/include/openssl)
-
-find_library(OPENSSL_LIBRARY NAMES ssl
-             PATHS /usr/lib /usr/local/lib  /usr/local/opt/openssl/lib ${OPENSSL_DIR}/lib)
-
-find_library(CRYPTO_LIBRARY NAMES crypto
-             PATHS /usr/lib /usr/local/lib  /usr/local/opt/openssl/lib ${OPENSSL_DIR}/lib)
-
-set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARY} ${CRYPTO_LIBRARY})
-set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set OPENSSL_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(OpenSSL  DEFAULT_MSG
-              OPENSSL_LIBRARY CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
-
-mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARY CRYPTO_LIBRARY)
-
-if (OPENSSL_FOUND AND NOT TARGET OpenSSL::lib)
-    add_library(OpenSSL::crypto SHARED IMPORTED)
-    set_target_properties(OpenSSL::crypto PROPERTIES
-            IMPORTED_LOCATION "${CRYPTO_LIBRARY}"
-            INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}"
-    )
-
-    add_library(OpenSSL::lib SHARED IMPORTED)
-    set_target_properties(OpenSSL::lib PROPERTIES
-            IMPORTED_LOCATION "${OPENSSL_LIBRARY}"
-            INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}"
-            INTERFACE_LINK_LIBRARIES OpenSSL::crypto
-    )
-endif ()


Add missed CMake include for check_include_file

Issue #2820

--- cmake/OpenCVFindLibsGrfmt.cmake
+++ cmake/OpenCVFindLibsGrfmt.cmake
@@ -116,6 +116,7 @@
   else()
     include(FindPNG)
     if(PNG_FOUND)
+      include(CheckIncludeFile)
       check_include_file("${PNG_PNG_INCLUDE_DIR}/png.h"        HAVE_PNG_H)
       check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
       if(HAVE_PNG_H)


OpenNI2 is a static library on Windows platform

--- cmake/modules/FindOpenNI2.cmake
+++ cmake/modules/FindOpenNI2.cmake
@@ -34,9 +34,11 @@
     find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS $ENV{OPENNI2_INCLUDE64} "$ENV{OPEN_NI_INSTALL_PATH64}Include" DOC "OpenNI2 c++ interface header")
     find_library(OPENNI2_LIBRARY "OpenNI2" PATHS $ENV{OPENNI2_LIB64} DOC "OpenNI2 library")
   endif()
+  set(LIBRARY_TYPE STATIC)
 elseif(UNIX OR APPLE)
   find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "/usr/include/ni2" "/usr/include/openni2" $ENV{OPENNI2_INCLUDE} DOC "OpenNI2 c++ interface header")
   find_library(OPENNI2_LIBRARY "OpenNI2" PATHS "/usr/lib" $ENV{OPENNI2_REDIST} DOC "OpenNI2 library")
+  set(LIBRARY_TYPE SHARED)
 endif()

 if(OPENNI2_LIBRARY AND OPENNI2_INCLUDES)
@@ -69,7 +71,7 @@
 if(HAVE_OPENNI2)

   ## Imported target
-  add_library(openni2 SHARED IMPORTED)
+  add_library(openni2 ${LIBRARY_TYPE} IMPORTED)
   set_property(TARGET openni2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${OPENNI2_INCLUDE_DIR})
   set_property(TARGET openni2 PROPERTY IMPORTED_LOCATION ${OPENNI2_LIBRARY})


Only consider openvdb debug if necessary.

--- cmake/modules/FindOpenVDB.cmake
+++ cmake/modules/FindOpenVDB.cmake
@@ -223,7 +223,9 @@
   if (_is_multi)
     list(APPEND OpenVDB_LIB_COMPONENTS ${OpenVDB_${COMPONENT}_LIBRARY_RELEASE} ${OpenVDB_${COMPONENT}_LIBRARY_DEBUG})

-    if(OpenVDB_${COMPONENT}_LIBRARY_RELEASE AND ${OpenVDB_${COMPONENT}_LIBRARY_DEBUG})
+    list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _has_debug)
+
+    if(OpenVDB_${COMPONENT}_LIBRARY_RELEASE AND (_has_debug LESS 0 OR OpenVDB_${COMPONENT}_LIBRARY_DEBUG))
       set(OpenVDB_${COMPONENT}_FOUND TRUE)
     else()
       set(OpenVDB_${COMPONENT}_FOUND FALSE)


comment rpm dependance

comment rpm dependance

--- cmake/packaging/Packaging.cmake
+++ cmake/packaging/Packaging.cmake
@@ -40,8 +40,8 @@
   set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${POSTINST_SCRIPT})

-set(CPACK_DEBIAN_PACKAGE_DEPENDS "libopenmpi1.3, libqt4-sql-sqlite, libxml++1.0c2a, libboost-all-dev, nvidia-settings")
-set(CPACK_RPM_PACKAGE_REQUIRES "libopenmpi1.3, libqt4-sql-sqlite, libxml++1.0c2a, libboost-all-dev, nvidia-settings")
+set(CPACK_DEBIAN_PACKAGE_DEPENDS "libopenmpi1.3, libqt4-sql-sqlite, libboost-all-dev, nvidia-settings")
+#set(CPACK_RPM_PACKAGE_REQUIRES "libopenmpi1.3, libqt4-sql-sqlite, libboost-all-dev, nvidia-settings")

 else("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
   set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")


Was using features only available in CMake 3.8

Removed

--- common/cmake/CommonHeader.cmake
+++ common/cmake/CommonHeader.cmake
@@ -1,11 +1,4 @@
-list (FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_14 CXX_STD_14)
-
-set (CXX_STD_MAX 11)
-if (${CXX_STD_14} GREATER_EQUAL -1)
-	set (CXX_STD_MAX 14)
-endif (${CXX_STD_14} GREATER_EQUAL -1)
-
-set (CMAKE_CXX_STANDARD ${CXX_STD_MAX})
+set (CMAKE_CXX_STANDARD 11)
 set (CMAKE_CXX_STANDARD_REQUIRED TRUE)

 # adapted from


cmake: get_verilog_includes: do not append source dir to path

Signed-off-by: Karol Gugala <38af71640571ee4b5093d4f69ffca1ac454f2948@antmicro.com>

--- common/cmake/file_targets.cmake
+++ common/cmake/file_targets.cmake
@@ -153,7 +153,7 @@
     if(NOT "${INCLUDE}" STREQUAL "")
       get_filename_component(
         ABS_PATH_TO_INCLUDE
-        ${CMAKE_CURRENT_SOURCE_DIR}/${INCLUDE}
+        ${INCLUDE}
         ABSOLUTE
         BASE_DIR
         ${symbiflow-arch-defs_SOURCE_DIR}


download only gtest external project when testing enabled

--- cmake/3rdParty.cmake
+++ cmake/3rdParty.cmake
@@ -1,6 +1,8 @@
 find_package(Threads REQUIRED)

 include(ExternalProject)
+
+if( OPTION_BUILD_TESTS )

 ExternalProject_Add(
     gtest
@@ -29,3 +31,5 @@

 include_directories("${source_dir}/googletest/include"
                     "${source_dir}/googlemock/include")
+
+endif( OPTION_BUILD_TESTS )


simpler cmake for msvc

simpler cmake for msvc

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -7,128 +7,65 @@
 # LLVM_LIBRARIES
 # LLVM_LIBDIRS

-if(MSVC)
-  find_package(LLVM REQUIRED CONFIG)
+find_program(LLVM_CONFIG_EXE
+    NAMES llvm-config-5.0 llvm-config
+    PATHS
+        "/mingw64/bin"
+        "/c/msys64/mingw64/bin"
+        "c:/msys64/mingw64/bin"
+        "C:/Libraries/llvm-5.0.0/bin")

-  # TODO: this currently doesn't work, it currently defines UNICODE but zig
-  #       uses MBCS
-  #add_definitions(${LLVM_DEFINITIONS})
-
-  link_directories(${LLVM_LIBRARY_DIRS})
-  llvm_map_components_to_libnames(LLVM_LIBRARIES
-      LTO
-      Symbolize
-      XCoreDisassembler
-      XCoreCodeGen
-      XCoreAsmPrinter
-      SystemZDisassembler
-      SystemZCodeGen
-      SystemZAsmParser
-      SystemZAsmPrinter
-      SparcDisassembler
-      SparcCodeGen
-      SparcAsmParser
-      SparcAsmPrinter
-      PowerPCDisassembler
-      PowerPCCodeGen
-      PowerPCAsmParser
-      PowerPCAsmPrinter
-      NVPTXCodeGen
-      NVPTXAsmPrinter
-      MSP430CodeGen
-      MSP430AsmPrinter
-      MipsDisassembler
-      MipsCodeGen
-      MipsAsmParser
-      MipsAsmPrinter
-      LanaiDisassembler
-      LanaiCodeGen
-      LanaiAsmParser
-      LanaiAsmPrinter
-      HexagonDisassembler
-      HexagonCodeGen
-      HexagonAsmParser
-      BPFDisassembler
-      BPFCodeGen
-      BPFAsmPrinter
-      ARMDisassembler
-      ARMCodeGen
-      ARMAsmParser
-      ARMAsmPrinter
-      AMDGPUDisassembler
-      AMDGPUCodeGen
-      AMDGPUAsmParser
-      AMDGPUAsmPrinter
-      AArch64Disassembler
-      AArch64CodeGen
-      AArch64AsmParser
-      AArch64AsmPrinter
-      LibDriver
-      X86Disassembler
-      X86AsmParser
-      X86CodeGen
-      X86AsmPrinter
-      Core
-  )
-
-else()
-  find_program(LLVM_CONFIG_EXE
-      NAMES llvm-config-5.0 llvm-config
-      PATHS
-          "/mingw64/bin"
-          "/c/msys64/mingw64/bin"
-          "c:/msys64/mingw64/bin"
-          "C:/Libraries/llvm-5.0.0/bin")
-
-  if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug"))
-    execute_process(
-        COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static
-        OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
-    string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}")
-
-    execute_process(
-        COMMAND ${LLVM_CONFIG_EXE} --system-libs --link-static
-        OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
-    string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")
-
-    execute_process(
-        COMMAND ${LLVM_CONFIG_EXE} --libdir --link-static
-        OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
-    string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}")
-  endif()
-  if(NOT LLVM_LIBRARIES)
-    execute_process(
-        COMMAND ${LLVM_CONFIG_EXE} --libs
-        OUTPUT_VARIABLE LLVM_LIBRARIES
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-    execute_process(
-        COMMAND ${LLVM_CONFIG_EXE} --system-libs
-        OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-    execute_process(
-        COMMAND ${LLVM_CONFIG_EXE} --libdir
-        OUTPUT_VARIABLE LLVM_LIBDIRS
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
-  endif()
+if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug"))
+  execute_process(
+      COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static
+      OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}")

   execute_process(
-      COMMAND ${LLVM_CONFIG_EXE} --includedir
-      OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
+      COMMAND ${LLVM_CONFIG_EXE} --system-libs --link-static
+      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
       OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")

-  set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})
+  execute_process(
+      COMMAND ${LLVM_CONFIG_EXE} --libdir --link-static
+      OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}")
+endif()
+if(NOT LLVM_LIBRARIES)
+  execute_process(
+      COMMAND ${LLVM_CONFIG_EXE} --libs
+      OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}")

-  if(NOT LLVM_LIBRARIES)
-    find_library(LLVM_LIBRARIES NAMES LLVM LLVM-5.0 LLVM-5)
-  endif()
+  execute_process(
+      COMMAND ${LLVM_CONFIG_EXE} --system-libs
+      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")

-  link_directories("${CMAKE_PREFIX_PATH}/lib")
+  execute_process(
+      COMMAND ${LLVM_CONFIG_EXE} --libdir
+      OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}")
 endif()
+
+execute_process(
+    COMMAND ${LLVM_CONFIG_EXE} --includedir
+    OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})
+
+if(NOT LLVM_LIBRARIES)
+  find_library(LLVM_LIBRARIES NAMES LLVM LLVM-5.0 LLVM-5)
+endif()
+
+link_directories("${CMAKE_PREFIX_PATH}/lib")

 include(FindPackageHandleStandardArgs)


make ICC shut up, dunno why it gives this bogus warning

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -262,6 +262,7 @@
          set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   ${ALIAS_FLAGS}")
          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ALIAS_FLAGS}")
       endif()
+      vc_add_compiler_flag(Vc_DEFINITIONS "-diag-disable 913")
    elseif(Vc_COMPILER_IS_MSVC)
       if(_add_warning_flags)
          AddCompilerFlag("/wd4800") # Disable warning "forcing value to bool"


silence false positives about uninitialized values from GCC 4.4.7

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -257,6 +257,9 @@

          UserWarning("GCC 4.4.x shows false positives for -Wstrict-aliasing, thus we rather disable the warning. Use a newer GCC for better warnings.")
          AddCompilerFlag("-Wno-strict-aliasing")
+
+         UserWarning("GCC 4.4.x shows false positives for -Wuninitialized, thus we rather disable the warning. Use a newer GCC for better warnings.")
+         AddCompilerFlag("-Wno-uninitialized")
       elseif(Vc_GCC_VERSION VERSION_EQUAL 4.6.0)
          UserWarning("GCC 4.6.0 miscompiles AVX loads/stores, leading to spurious segfaults. Disabling AVX per default.")
          set(Vc_AVX_INTRINSICS_BROKEN true)


target_set_warnings(DISABLE ALL) now treats the includes as system

--- cmake/Warnings.cmake
+++ cmake/Warnings.cmake
@@ -3,72 +3,80 @@
 option(ENABLE_WARNINGS_SETTINGS "Allow target_set_warnings to add flags and defines. Set this to OFF if you want to provide your own warning parameters." ON)

 function(target_set_warnings)
-	if(NOT ENABLE_WARNINGS_SETTINGS)
-		return()
-	endif()
-	if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
-	  set(WMSVC TRUE)
-	elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-	  set(WGCC TRUE)
-	elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-	  set(WCLANG TRUE)
-	endif()
-	set(multiValueArgs ENABLE DISABLE AS_ERROR)
-	cmake_parse_arguments(this "" "" "${multiValueArgs}" ${ARGN})
-	list(FIND this_ENABLE "ALL" enable_all)
-	list(FIND this_DISABLE "ALL" disable_all)
-	list(FIND this_AS_ERROR "ALL" as_error_all)
-	if(NOT ${enable_all} EQUAL -1)
-	  if(WMSVC)
-		# Not all the warnings, but WAll is unusable when using libraries
-		# Unless you'd like to support MSVC in the code with pragmas, this is probably the best option
-	    list(APPEND WarningFlags "/W4")
-	  elseif(WGCC)
-	    list(APPEND WarningFlags "-Wall" "-Wextra" "-Wpedantic")
-	  elseif(WCLANG)
-	    list(APPEND WarningFlags "-Wall" "-Weverything" "-Wpedantic")
-	  endif()
-	elseif(NOT ${disable_all} EQUAL -1)
-	  if(WMSVC)
-	    list(APPEND WarningFlags "/w" "/W0")
-	  elseif(WGCC OR WCLANG)
-	    list(APPEND WarningFlags "-w")
-	  endif()
-	endif()
+    if(NOT ENABLE_WARNINGS_SETTINGS)
+        return()
+    endif()
+    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+      set(WMSVC TRUE)
+    elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+      set(WGCC TRUE)
+    elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+      set(WCLANG TRUE)
+    endif()
+    set(multiValueArgs ENABLE DISABLE AS_ERROR)
+    cmake_parse_arguments(this "" "" "${multiValueArgs}" ${ARGN})
+    list(FIND this_ENABLE "ALL" enable_all)
+    list(FIND this_DISABLE "ALL" disable_all)
+    list(FIND this_AS_ERROR "ALL" as_error_all)
+    if(NOT ${enable_all} EQUAL -1)
+      if(WMSVC)
+        # Not all the warnings, but WAll is unusable when using libraries
+        # Unless you'd like to support MSVC in the code with pragmas, this is probably the best option
+        list(APPEND WarningFlags "/W4")
+      elseif(WGCC)
+        list(APPEND WarningFlags "-Wall" "-Wextra" "-Wpedantic")
+      elseif(WCLANG)
+        list(APPEND WarningFlags "-Wall" "-Weverything" "-Wpedantic")
+      endif()
+    elseif(NOT ${disable_all} EQUAL -1)
+      set(SystemIncludes TRUE) # Treat includes as if coming from system
+      if(WMSVC)
+        list(APPEND WarningFlags "/w" "/W0")
+      elseif(WGCC OR WCLANG)
+        list(APPEND WarningFlags "-w")
+      endif()
+    endif()

-	list(FIND this_DISABLE "Annoying" disable_annoying)
-	if(NOT ${disable_annoying} EQUAL -1)
-	  if(WMSVC)
-	    # bounds-checked functions require to set __STDC_WANT_LIB_EXT1__ which we usually don't need/want
-	    list(APPEND WarningDefinitions -D_CRT_SECURE_NO_WARNINGS)
-		# disable C4514 C4710 C4711... Those are useless to add most of the time
-		#list(APPEND WarningFlags "/wd4514" "/wd4710" "/wd4711")
-		#list(APPEND WarningFlags "/wd4365") #signed/unsigned mismatch
-		#list(APPEND WarningFlags "/wd4668") # is not defined as a preprocessor macro, replacing with '0' for
-	  elseif(WCLANG)
-		list(APPEND WarningFlags -Wno-unknown-warning-option -Wno-padded -Wno-undef -Wno-reserved-id-macro -fcomment-block-commands=test,retval)
-		if(NOT CMAKE_CXX_STANDARD EQUAL 98)
-			list(APPEND WarningFlags -Wno-c++98-compat -Wno-c++98-compat-pedantic)
-		endif()
-		if ("${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") # clang-cl has some VCC flags by default that it will not recognize...
-			list(APPEND WarningFlags -Wno-unused-command-line-argument)
-		endif()
-	  endif()
-	endif()
+    list(FIND this_DISABLE "Annoying" disable_annoying)
+    if(NOT ${disable_annoying} EQUAL -1)
+      if(WMSVC)
+        # bounds-checked functions require to set __STDC_WANT_LIB_EXT1__ which we usually don't need/want
+        list(APPEND WarningDefinitions -D_CRT_SECURE_NO_WARNINGS)
+        # disable C4514 C4710 C4711... Those are useless to add most of the time
+        #list(APPEND WarningFlags "/wd4514" "/wd4710" "/wd4711")
+        #list(APPEND WarningFlags "/wd4365") #signed/unsigned mismatch
+        #list(APPEND WarningFlags "/wd4668") # is not defined as a preprocessor macro, replacing with '0' for
+      elseif(WGCC OR WCLANG)
+        list(APPEND WarningFlags -Wno-switch-enum)
+        if(WCLANG)
+          list(APPEND WarningFlags -Wno-unknown-warning-option -Wno-padded -Wno-undef -Wno-reserved-id-macro -fcomment-block-commands=test,retval)
+          if(NOT CMAKE_CXX_STANDARD EQUAL 98)
+              list(APPEND WarningFlags -Wno-c++98-compat -Wno-c++98-compat-pedantic)
+          endif()
+          if ("${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") # clang-cl has some VCC flags by default that it will not recognize...
+              list(APPEND WarningFlags -Wno-unused-command-line-argument)
+          endif()
+        endif(WCLANG)
+      endif()
+    endif()

-	if(NOT ${as_error_all} EQUAL -1)
-	  if(WMSVC)
-	    list(APPEND WarningFlags "/WX")
-	  elseif(WGCC OR WCLANG)
-	    list(APPEND WarningFlags "-Werror")
-	  endif()
-	endif()
-	foreach(target IN LISTS this_UNPARSED_ARGUMENTS)
-	  if(WarningFlags)
-		target_compile_options(${target} PRIVATE ${WarningFlags})
-	  endif()
-	  if(WarningDefinitions)
-		target_compile_definitions(${target} PRIVATE ${WarningDefinitions})
-	  endif()
-	endforeach()
+    if(NOT ${as_error_all} EQUAL -1)
+      if(WMSVC)
+        list(APPEND WarningFlags "/WX")
+      elseif(WGCC OR WCLANG)
+        list(APPEND WarningFlags "-Werror")
+      endif()
+    endif()
+    foreach(target IN LISTS this_UNPARSED_ARGUMENTS)
+      if(WarningFlags)
+        target_compile_options(${target} PRIVATE ${WarningFlags})
+      endif()
+      if(WarningDefinitions)
+        target_compile_definitions(${target} PRIVATE ${WarningDefinitions})
+      endif()
+      if(SystemIncludes)
+        set_target_properties(${target} PROPERTIES
+            INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${target},INTERFACE_INCLUDE_DIRECTORIES>)
+      endif()
+    endforeach()
 endfunction(target_set_warnings)


Enable -Wunused-result for clang

Enable -Wunused-result for clang

--- cmake/bde_ufid.cmake
+++ cmake/bde_ufid.cmake
@@ -418,6 +418,7 @@
                 -Wsign-compare
                 -Wstrict-overflow=1
                 -Wtype-limits
+                -Wunused-result
                 -Wvla
                 -Wvolatile-register-var
                 -Wwrite-strings
@@ -452,6 +453,7 @@
                 -Wsign-compare
                 -Wstrict-overflow=1
                 -Wtype-limits
+                -Wunused-result
                 -Wvla
                 -Wvolatile-register-var
                 -Wwrite-strings


remove iOS cmake warning

remove iOS cmake warning

--- toolchain/iOS/iOS.cmake
+++ toolchain/iOS/iOS.cmake
@@ -27,6 +27,12 @@
 # find_host_package (PROGRAM ARGS)
 #  A macro used to find executable programs on the host system, not within the iOS environment.
 #  Thanks to the android-cmake project for providing the command
+if (POLICY CMP0011)
+  cmake_policy (SET CMP0011 NEW)
+endif ()
+if (POLICY CMP0054)
+  cmake_policy (SET CMP0054 NEW)
+endif ()

 # Standard settings
 set (CMAKE_SYSTEM_NAME Darwin)


add ignore warning

add ignore warning

--- utils.cmake
+++ utils.cmake
@@ -73,6 +73,7 @@
 		add_definitions(-Wno-error=unused-variable)
 		add_definitions(-Wno-error=unused-parameter)
 		add_definitions(-Wno-error=deprecated-declarations)
+		add_definitions(-Wno-error=sign-conversion)

 		if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
 			add_definitions(-Wno-error=suggest-attribute=noreturn)


Libprocess: Added target for "mesos-tcp-connect" binary.

Review: https://reviews.apache.org/r/51606

--- 3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ 3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
@@ -162,6 +162,11 @@
   MESOS_MASTER mesos-master
   CACHE STRING "Target for master")

+# Define target for tcp-connect.
+set(
+  MESOS_TCP_CONNECT mesos-tcp-connect
+  CACHE STRING "Target for tcp-connect")
+
 # Define target for usage.
 set(
   MESOS_USAGE mesos-usage


cook: Add patch cmd for ragel build (signed char confusion on aarch64)

Ragel has wrong assumption for char type. Patch[1] has been
merged by Ragel and similar fix should be applied here.
Without this change, request_parser test will fail on a
platform that char is treated as unsigned.

[1] https://github.com/adrian-thurston/ragel/pull/52

Change-Id: I3372dd1817f794dcfe5c1eff7d0e5aa640949955
Signed-off-by: Jun He <05c4aea3b428e9f4cbf962ab56f389db00194977@arm.com>
Message-Id: <20201221095439.29372-1-05c4aea3b428e9f4cbf962ab56f389db00194977@arm.com>

--- cooking_recipe.cmake
+++ cooking_recipe.cmake
@@ -202,6 +202,8 @@
   EXTERNAL_PROJECT_ARGS
     URL http://www.colm.net/files/ragel/ragel-6.10.tar.gz
     URL_MD5 748cae8b50cffe9efcaa5acebc6abf0d
+    PATCH_COMMAND
+      sed -i "s/ CHAR_M/ SCHAR_M/g" ragel/common.cpp
     # This is upsetting.
     BUILD_IN_SOURCE YES
     CONFIGURE_COMMAND


use add_link_options instead of link_libraries, as it obeys SHELL prefix

--- build_options.cmake
+++ build_options.cmake
@@ -43,7 +43,7 @@
     #                                         (01.06.2016.) (Domagoj Saric)
     string( TOUPPER ${configuration} configuration )
     foreach( arg ${ARGN} )
-        link_libraries( $<$<CONFIG:${configuration}>:${arg}> )
+        add_link_options( $<$<CONFIG:${configuration}>:${arg}> )
     endforeach()
 endfunction()


CMake: update dependencies to latest release

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -155,43 +155,43 @@
     execute_process(COMMAND ${CMAKE_COMMAND}
         --build ${PROJECT_BINARY_DIR}/pugixml-1.10 ${BUILD_COMMAND_OPTS})

-    find_package(Freetype)
+    #find_package(Freetype)
     if (NOT FREETYPE_FOUND)
         message(STATUS "Building freetype")
         file(DOWNLOAD
-            https://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.gz
-            ${PROJECT_BINARY_DIR}/freetype-2.9.tar.gz)
+            https://download.savannah.gnu.org/releases/freetype/freetype-2.10.1.tar.gz
+            ${PROJECT_BINARY_DIR}/freetype-2.10.1.tar.gz)
         execute_process(COMMAND ${CMAKE_COMMAND}
-            -E tar xf freetype-2.9.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
+            -E tar xf freetype-2.10.1.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
         # patch toolchain for iOS
         execute_process(COMMAND ${CMAKE_COMMAND} -E copy
             ${PROJECT_SOURCE_DIR}/CMake/toolchain/ios.toolchain.xcode.cmake
-            freetype-2.9/builds/cmake/iOS.cmake
+            freetype-2.10.1/builds/cmake/iOS.cmake
             WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
         execute_process(COMMAND ${BUILD_COMMAND_COMMON}
             -DBUILD_SHARED_LIBS=${OGREDEPS_SHARED}
             -DWITH_PNG=OFF
-            -DWITH_BZip2=OFF # tries to use it on iOS otherwise
+            -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE # tries to use it on iOS otherwise
             # workaround for broken iOS toolchain in freetype
-            -DPROJECT_SOURCE_DIR=${PROJECT_BINARY_DIR}/freetype-2.9
-            ${PROJECT_BINARY_DIR}/freetype-2.9
-            WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/freetype-2.9/objs)
+            -DPROJECT_SOURCE_DIR=${PROJECT_BINARY_DIR}/freetype-2.10.1
+            ${PROJECT_BINARY_DIR}/freetype-2.10.1
+            WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/freetype-2.10.1/objs)
         execute_process(COMMAND ${CMAKE_COMMAND}
-            --build ${PROJECT_BINARY_DIR}/freetype-2.9/objs ${BUILD_COMMAND_OPTS})
+            --build ${PROJECT_BINARY_DIR}/freetype-2.10.1/objs ${BUILD_COMMAND_OPTS})
     endif()

     if(MSVC OR MINGW) # other platforms dont need this
         message(STATUS "Building SDL2")
         file(DOWNLOAD
-            https://libsdl.org/release/SDL2-2.0.8.tar.gz
-            ${PROJECT_BINARY_DIR}/SDL2-2.0.8.tar.gz)
+            https://libsdl.org/release/SDL2-2.0.10.tar.gz
+            ${PROJECT_BINARY_DIR}/SDL2-2.0.10.tar.gz)
         execute_process(COMMAND ${CMAKE_COMMAND}
-            -E tar xf SDL2-2.0.8.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
+            -E tar xf SDL2-2.0.10.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
         execute_process(COMMAND ${CMAKE_COMMAND}
             -E make_directory ${PROJECT_BINARY_DIR}/SDL2-build)
         execute_process(COMMAND ${BUILD_COMMAND_COMMON}
             -DSDL_STATIC=FALSE
-            ${PROJECT_BINARY_DIR}/SDL2-2.0.8
+            ${PROJECT_BINARY_DIR}/SDL2-2.0.10
             WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/SDL2-build)
         execute_process(COMMAND ${CMAKE_COMMAND}
             --build ${PROJECT_BINARY_DIR}/SDL2-build ${BUILD_COMMAND_OPTS})


Fix vtk_module_dep_includes to scan dependencies correctly.

Although vtk_module_dep_includes() is expected to recursively scan the
dependencies to build the include dirs list, it didn't work as expected with the
macro was called repeatedly within the same scope for different modules.  The
problem was that the code that managed the recursion traversal
(_vtk_module_config_recurse) uses variables to avoid duplicate traversal and
that was resulting identifying incorrect duplicate visits when
vtk_module_dep_includes() was used more than once. Fixed that by ensuring that
vtk_module_dep_includes() scope the variable namespace using the modules name.

Change-Id: I23fb97a9dafaf43b7ebdf0f837ee130b3ded9165

--- CMake/vtkModuleAPI.cmake
+++ CMake/vtkModuleAPI.cmake
@@ -45,9 +45,9 @@
 # Loads the <module>_DEPENDS_INCLUDE_DIRS variable.
 macro(vtk_module_dep_includes mod)
   vtk_module_load("${mod}")
-  vtk_module_config(_dep ${${mod}_DEPENDS})
-  if(_dep_INCLUDE_DIRS)
-    set(${mod}_DEPENDS_INCLUDE_DIRS ${_dep_INCLUDE_DIRS})
+  vtk_module_config(_dep_${mod} ${${mod}_DEPENDS})
+  if(_dep_${mod}_INCLUDE_DIRS)
+    set(${mod}_DEPENDS_INCLUDE_DIRS ${_dep_${mod}_INCLUDE_DIRS})
   endif()
 endmacro()


Force build ITKOpenJPEG Module

Force build ITKOpenJPEG Module

--- CMakeExternals/ITK.cmake
+++ CMakeExternals/ITK.cmake
@@ -40,6 +40,8 @@
   # see MITK bug #17338
   list(APPEND additional_cmake_args
     -DModule_ITKReview:BOOL=ON
+  # for 4.7, the OpenJPEG is needed by review but the variable must be set
+    -DModule_ITKOpenJPEG:BOOL=ON
   )

   set(vcl_constexpr_patch)


fix sndfile on widows: the lib is called libsndfile-1.lib

Change-Id: Ifd7b5e26a0556fd06adfcd28fe0abdd73cafdb48
Reviewed-on: http://gerrit.aldebaran.lan/25253
Tested-by: gerrit
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/modules/sndfile-config.cmake
+++ cmake/qibuild/modules/sndfile-config.cmake
@@ -4,5 +4,5 @@

 clean(SNDFILE)
 fpath(SNDFILE sndfile.h)
-flib(SNDFILE sndfile)
+flib(SNDFILE sndfile libsndfile-1)
 export_lib(SNDFILE)


CMake: Cleanup

CMake: Cleanup

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@30173 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_cached_variables.cmake
+++ deal.II/cmake/setup_cached_variables.cmake
@@ -39,7 +39,6 @@
 #     DEAL_II_PREFER_STATIC_LIBS
 #     DEAL_II_STATIC_EXECUTABLE
 #     CMAKE_INSTALL_RPATH_USE_LINK_PATH
-#     CMAKE_C_FLAGS                     *)
 #     CMAKE_CXX_FLAGS                   *)
 #     DEAL_II_LINKER_FLAGS              *)
 #     DEAL_II_CXX_FLAGS_DEBUG
@@ -48,7 +47,7 @@
 #     DEAL_II_LINKER_FLAGS_RELEASE
 #     DEAL_II_WITH_64BIT_INDICES
 #
-# *)  May also be set via environment variable (CFLAGS, CXXFLAGS, LDFLAGS)
+# *)  May also be set via environment variable (CXXFLAGS, LDFLAGS)
 #     (a nonempty cached variable has precedence and will not be
 #     overwritten by environment)
 #


Add hint for finding build-specific library builds

--- cmake/FindCAF.cmake
+++ cmake/FindCAF.cmake
@@ -91,7 +91,8 @@
                      /usr/local/lib
                      /opt/local/lib
                      /sw/lib
-                     ${CMAKE_INSTALL_PREFIX}/lib)
+                     ${CMAKE_INSTALL_PREFIX}/lib
+                     ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_BUILD_TYPE})
       mark_as_advanced(CAF_LIBRARY_${UPPERCOMP})
       if ("${CAF_LIBRARY_${UPPERCOMP}}"
           STREQUAL "CAF_LIBRARY_${UPPERCOMP}-NOTFOUND")


I fixed the configuration of OpenSSL for 32 bits MacOS X.

--- cmake/OpenSSL.cmake
+++ cmake/OpenSSL.cmake
@@ -24,8 +24,14 @@
 else()
     set(OpenSSL_InstallCommand make install)
     if(DARWIN)
-        set(OpenSSL_ConfigureCommand "./Configure" darwin64-x86_64-cc
-            "--prefix=${ThirdPartyCacheInstall}" shared )
+        if(SQUEAK_PLATFORM_X86_64)
+            set(OpenSSL_ConfigureCommand "./Configure" darwin64-x86_64-cc
+                "--prefix=${ThirdPartyCacheInstall}" shared )
+        elseif(SQUEAK_PLATFORM_X86_32)
+            set(OpenSSL_ConfigureCommand "./Configure" darwin-i386-cc
+                "--prefix=${ThirdPartyCacheInstall}" shared )
+        endif()
+
         set(OpenSSL_BuildCommand
             env
             "LDFLAGS=-Wl,-rpath,@executable_path:@executable_path/Plugins --sysroot=${CMAKE_OSX_SYSROOT}"


Update Python information shown in CMake summary (#2132)

* Do not show Python library in cmake summary as we no longer link with libpython

* Show python include dirs in cmake summary

--- cmake/Summary.cmake
+++ cmake/Summary.cmake
@@ -24,7 +24,7 @@
   message(STATUS "  BUILD_PYTHON          : ${BUILD_PYTHON}")
   if (${BUILD_PYTHON})
     message(STATUS "    Python version      : ${PYTHONLIBS_VERSION_STRING}")
-    message(STATUS "    Python library      : ${PYTHON_LIBRARIES}")
+    message(STATUS "    Python includes     : ${PYTHON_INCLUDE_DIRS}")
   endif()
   message(STATUS "  BUILD_SHARED_LIBS     : ${BUILD_SHARED_LIBS}")
   message(STATUS "  BUILD_TEST            : ${BUILD_TEST}")


Add .zenodo.json to alpakaIDE project

Add .zenodo.json to alpakaIDE project

--- alpakaConfig.cmake
+++ alpakaConfig.cmake
@@ -586,7 +586,7 @@
 append_recursive_files_add_to_src_group("${_ALPAKA_ROOT_DIR}/doc/markdown" "${_ALPAKA_ROOT_DIR}" "md" _ALPAKA_FILES_DOC)
 SET_SOURCE_FILES_PROPERTIES(${_ALPAKA_FILES_DOC} PROPERTIES HEADER_FILE_ONLY TRUE)

-SET(_ALPAKA_FILES_OTHER "${_ALPAKA_ROOT_DIR}/.gitignore" "${_ALPAKA_ROOT_DIR}/.travis.yml" "${_ALPAKA_ROOT_DIR}/appveyor.yml" "${_ALPAKA_ROOT_DIR}/COPYING" "${_ALPAKA_ROOT_DIR}/COPYING.LESSER" "${_ALPAKA_ROOT_DIR}/README.md")
+SET(_ALPAKA_FILES_OTHER "${_ALPAKA_ROOT_DIR}/.gitignore" "${_ALPAKA_ROOT_DIR}/.travis.yml" "${_ALPAKA_ROOT_DIR}/.zenodo.json" "${_ALPAKA_ROOT_DIR}/appveyor.yml" "${_ALPAKA_ROOT_DIR}/COPYING" "${_ALPAKA_ROOT_DIR}/COPYING.LESSER" "${_ALPAKA_ROOT_DIR}/README.md")
 SET_SOURCE_FILES_PROPERTIES(${_ALPAKA_FILES_OTHER} PROPERTIES HEADER_FILE_ONLY TRUE)

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


deal with CMake double expansion

deal with CMake double expansion

--- ros_middleware_interface/cmake/register_ros_middleware_implementation.cmake
+++ ros_middleware_interface/cmake/register_ros_middleware_implementation.cmake
@@ -6,7 +6,7 @@
 macro(register_ros_middleware_implementation)
   #message(" - register_ros_middleware_implementation()")

-  if(NOT "${ARGN}" STREQUAL "")
+  if(NOT "${ARGN} " STREQUAL " ")
     message(FATAL_ERROR "register_ros_middleware_implementation() called with "
       "unused arguments: ${ARGN}")
   endif()


Amend comments, consistent TEST_ variable use.

Comments in TestScriptUtils.cmake updated and expanded.

add_test_script() now regards TEST_ARGS, TEST_PREFIX
in a manner consistent with CommonCPPCTest.cmake.

add_test_class_target renamed to add_test_class.

--- TestScriptUtils.cmake
+++ TestScriptUtils.cmake
@@ -1,16 +1,42 @@
 # @author Sam Yates

 # Utility functions for manipulating test labels and producing
-# tests from scripts.
+# tests from scripts:
+#
+# 1. add_test_class(label [label2 ...])
+#
+#    Create a target with name test-label (or test-label-label2 etc.)
+#    which runs only those tests possessing all of the supplied labels.
+#
+#
+# 2. add_test_label(name label ...)
+#
+#    Add the given labels to the test 'name'.
+#
+#
+# 3. add_test_script(name script interp)
+#
+#    Add a test 'name' that runs the given script, using the
+#    interpreter 'interp'. If no interpreter is supplied,
+#    the script will be run with /bin/sh.
+#
+#    Uses the following variables to customize the new test:
+#    * TEST_LABEL, ${NAME}_TEST_LABEL
+#          If defined, apply the label(s) in these variable to the
+#          new test.
+#    * TEST_ARGS, ${NAME}_TEST_ARGS
+#          Additional arguments to pass to the script.
+#          ${NAME}_TEST_ARGS takes priority over TEST_ARGS.
+#    * TEST_ENVIRONMENT
+#          Additional environment variables to define for the test;
+#          added to test properties.
+#    * TEST_PREFIX, ${NAME}_TEST_PREFIX
+#          If defined, preface the interpreter with this prefix.
+#          ${NAME}_TEST_PREFIX takes priority over TEST_PREFIX.

 function(add_test_label NAME)
   set_property(TEST ${NAME} APPEND PROPERTY LABELS ${ARGN})
 endfunction()
-
-# If TEST_LABEL is defined, set the label(s) in this variable on the new test.
-# If TEST_ENVIRONMENT is defined, add to the test properties.
-# If TEST_PREFIX or ${NAME}_TEST_PREFIX is defined, preface the interpreter
-# with this prefix.

 function(add_test_script NAME SCRIPT INTERP)
   set(RUN_PREFIX ${TEST_PREFIX})
@@ -21,26 +47,28 @@
   if(NOT INTERP)
     set(INTERP "/bin/sh")
   endif()
+
+  set(RUN_ARGS ${TEST_ARGS})
+  if (${NAME}_TEST_ARGS)
+    set(RUN_ARGS ${${NAME}_TEST_ARGS})
+  endif()
+
   add_test(NAME ${NAME}
-           COMMAND ${RUN_PREFIX} ${INTERP} "${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT}"
+           COMMAND ${RUN_PREFIX} ${INTERP} "${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT}" ${RUN_ARGS}
            WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
-  if(TEST_LABEL)
-    add_test_label(${NAME} ${TEST_LABEL})
+
+  # Add test labels
+  set(TEST_LABELS ${TEST_LABEL} ${${NAME}_TEST_LABEL})
+  if (TEST_LABELS)
+    add_test_label(${NAME} ${TEST_LABELS})
   endif()
+
   if(TEST_ENVIRONMENT)
     set_property(TEST ${NAME} PROPERTY ENVIRONMENT ${TEST_ENVIRONMENT})
   endif()
 endfunction()

-# Generate test targets from a series of test labels.
-# Example usage: add_test_class_target(foo bar) will create a new test target:
-#
-# test-foo-bar:
-#      ctest -L ^foo$ -L ^bar$
-#
-# which will run all tests which have both the label 'foo' and 'bar'.
-
-function(add_test_class_target)
+function(add_test_class)
   string(REPLACE ";" "-" TEST_SUFFIX "${ARGN}")
   string(REPLACE ";" "$$;-L;^" TEST_LOPTS "${ARGN}")


Small oversight: Make CMake recognise that Poco was found

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%40794

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -110,7 +110,7 @@

 # POCO
 find_package(POCO)
-macro_log_feature(Poco_FOUND "POCO" "POCO framework" "http://pocoproject.org/" FALSE "" "")
+macro_log_feature(POCO_FOUND "POCO" "POCO framework" "http://pocoproject.org/" FALSE "" "")


emscripten: go back to using emar because it's hard to find the right llvm-ar on Windows

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -148,8 +148,7 @@
 endif()
 if (EXISTS "${EMSCRIPTEN_DOT_FILE}")
     set(EMSC_COMMON_FLAGS "${EMSC_COMMON_FLAGS} --em-config ${EMSCRIPTEN_DOT_FILE} --cache ${EMSCRIPTEN_CACHE}")
-    # FIXME: if calling llvm-ar directory works everywhere, the following line can be removed
-    #    set(EMSC_AR_FLAGS "${EMSC_AR_FLAGS} --em-config ${EMSCRIPTEN_DOT_FILE}")
+    set(EMSC_AR_FLAGS "${EMSC_AR_FLAGS} --em-config ${EMSCRIPTEN_DOT_FILE}")
 else()
     # no sdk-embedded config found, use the default (~/.emscripten and ~/.emscripten_cache)
     message(WARNING "Using global emscripten config and cache in '~'!")
@@ -168,9 +167,9 @@
 # specify cross-compilers
 set(CMAKE_C_COMPILER "${EMSCRIPTEN_ROOT_PATH}/emcc${EMCC_SUFFIX}" CACHE PATH "gcc" FORCE)
 set(CMAKE_CXX_COMPILER "${EMSCRIPTEN_ROOT_PATH}/em++${EMCC_SUFFIX}" CACHE PATH "g++" FORCE)
-set(CMAKE_AR "${EMSCRIPTEN_LLVM_ROOT}/llvm-ar" CACHE PATH "archive" FORCE)
+set(CMAKE_AR "${EMSCRIPTEN_ROOT_PATH}/emar${EMCC_SUFFIX}" CACHE PATH "archive" FORCE)
 set(CMAKE_LINKER "${EMSCRIPTEN_ROOT_PATH}/emcc${EMCC_SUFFIX}" CACHE PATH "linker" FORCE)
-set(CMAKE_RANLIB "${EMSCRIPTEN_LLVM_ROOT}/llvm-ranlib" CACHE PATH "ranlib" FORCE)
+set(CMAKE_RANLIB "${EMSCRIPTEN_ROOT_PATH}/emranlib${EMCC_SUFFIX}" CACHE PATH "ranlib" FORCE)

 # only search for libraries and includes in the toolchain
 set(CMAKE_FIND_ROOT_PATH ${EMSCRIPTEN_ROOT_PATH})


Update device side FW

Update device side FW

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "a05f79d9fcd80fc18aa74d583e6c74fffe185d47")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "b263e5292bdb58d776d84a1a7bc1382d116f3488")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Update R finder for linux

Update R finder for linux

--- dev/cmake/Modules/FindR.cmake
+++ dev/cmake/Modules/FindR.cmake
@@ -32,7 +32,7 @@
     # see http://www.cmake.org/pipermail/cmake/2008-November/025423.html
     set(${arg2} ${arg1path} PARENT_SCOPE)
 ENDFUNCTION(chomp)
-
+STRING(STRIP ${R_HOME_TEXT} R_HOME_TEXT)
 MESSAGE(STATUS "R_HOME_TEXT = ${R_HOME_TEXT}")
 MESSAGE(STATUS "R_HOME_RESULT = ${R_HOME_RESULT}")
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/get_include.R R.home(component=\"include\"))
@@ -54,7 +54,7 @@
 find_library (
           R_LIBRARY
           R
-          PATHS ${R_BIN_DIR}
+          PATHS ${R_BIN_DIR} ${R_HOME_TEXT}/lib
           NO_DEFAULT_PATH
           NO_CMAKE_PATH
           )


Exclude Objective-C files from cppcheck

Exclude Objective-C files from cppcheck

--- CommonCheckTargets.cmake
+++ CommonCheckTargets.cmake
@@ -9,7 +9,8 @@
 include(CommonCPPLint)

 function(common_check_targets _name)
-  set(_exclude_pattern ".*moc_|.*qrc_.*\\.c.*$") # Qt moc and qrc files
+  # Qt moc & qrc files, C and Objective-C files
+  set(_exclude_pattern ".*moc_|.*qrc_.*\\.c.*|.*\\.mm.*$")

   # Get the list of files once for all check targets
   get_source_files(${_name} ${_exclude_pattern})


Updated FindDisplayCluster for the new dc::Stream API.

--- FindDisplayCluster.cmake
+++ FindDisplayCluster.cmake
@@ -24,14 +24,14 @@
   set(_DISPLAYCLUSTER_output 1)
 endif()

-find_path(_DISPLAYCLUSTER_INCLUDE_DIR dcStream.h
+find_path(_DISPLAYCLUSTER_INCLUDE_DIR dc/Stream.h
   HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{DISPLAYCLUSTER_ROOT} ${DISPLAYCLUSTER_ROOT}
   PATH_SUFFIXES include
   PATHS /usr /usr/local /opt /opt/local)

-if(_DISPLAYCLUSTER_INCLUDE_DIR AND EXISTS "${_DISPLAYCLUSTER_INCLUDE_DIR}/dcStream.h")
-  if(EXISTS "${_DISPLAYCLUSTER_INCLUDE_DIR}/dcVersion.h")
-   set(_DISPLAYCLUSTER_Version_file "${_DISPLAYCLUSTER_INCLUDE_DIR}/dcVersion.h")
+if(_DISPLAYCLUSTER_INCLUDE_DIR AND EXISTS "${_DISPLAYCLUSTER_INCLUDE_DIR}/dc/Stream.h")
+  if(EXISTS "${_DISPLAYCLUSTER_INCLUDE_DIR}/dc/Version.h")
+   set(_DISPLAYCLUSTER_Version_file "${_DISPLAYCLUSTER_INCLUDE_DIR}/dc/Version.h")
    file(READ ${_DISPLAYCLUSTER_Version_file} _DISPLAYCLUSTER_header_contents)
    string(REGEX REPLACE ".*#define DISPLAYCLUSTER_VERSION ([0-9].[0-9].[0-9]).*" "\\1"
      _DISPLAYCLUSTER_VERSION "${_DISPLAYCLUSTER_header_contents}")
@@ -45,7 +45,7 @@
   set(_DISPLAYCLUSTER_EPIC_FAIL TRUE)
   if(_DISPLAYCLUSTER_output)
     message(${_DISPLAYCLUSTER_output_type}
-      "Can't find DisplayCluster header file dcStream.h.")
+      "Can't find DisplayCluster header file dc/Stream.h.")
   endif()
 endif()


Add PROJECT_NAME to each git target.

Add PROJECT_NAME to each git target.

Subproject builds create targets with the same names unless we make them unique.

Warning : this commit renames the git targets
make-branch, branch, cut, tag, retag, erase, tarball-create, tarball
to the same but with _${PROJECT_NAME} appended.

--- GitTargets.cmake
+++ GitTargets.cmake
@@ -45,7 +45,7 @@
   set(BRANCH_VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
 endif()

-add_custom_target(make-branch
+add_custom_target(make-branch_${PROJECT_NAME}
   COMMAND ${GIT_EXECUTABLE} checkout -b ${BRANCH_VERSION}
   COMMENT "Create local branch ${BRANCH_VERSION}"
   WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
@@ -54,10 +54,10 @@
 if(TARGET flatten_git_external)
   set(BRANCH_DEP flatten_git_external)
 else()
-  set(BRANCH_DEP make-branch)
+  set(BRANCH_DEP make-branch_${PROJECT_NAME})
 endif()

-add_custom_target(branch
+add_custom_target(branch_${PROJECT_NAME}
   COMMAND ${GIT_EXECUTABLE} push origin ${BRANCH_VERSION}
   COMMENT "Add remote branch ${BRANCH_VERSION}"
   WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
@@ -65,7 +65,7 @@
   )

 # remove branch
-add_custom_target(cut
+add_custom_target(cut_${PROJECT_NAME}
   COMMAND ${GIT_EXECUTABLE} branch -d ${BRANCH_VERSION}
   COMMAND ${GIT_EXECUTABLE} push origin --delete ${BRANCH_VERSION}
   COMMENT "Remove branch ${BRANCH_VERSION}"
@@ -98,14 +98,14 @@
         \"Error creating tag ${VERSION} on branch ${TAG_BRANCH}\")
    endif()")

-add_custom_target(tag
+add_custom_target(tag_${PROJECT_NAME}
   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/gitbranchandtag.cmake
   COMMENT "Add tag ${VERSION}"
   WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
   )

 # remove tag
-add_custom_target(erase
+add_custom_target(erase_${PROJECT_NAME}
   COMMAND ${GIT_EXECUTABLE} tag -d ${VERSION}
   COMMAND ${GIT_EXECUTABLE} push origin :${VERSION}
   COMMENT "Remove tag ${VERSION}"
@@ -113,16 +113,16 @@
   )

 # move tag
-add_custom_target(retag
+add_custom_target(retag_${PROJECT_NAME}
   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/gitbranchandtag.cmake
   COMMENT "Add tag ${VERSION}"
   WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
-  DEPENDS erase)
+  DEPENDS erase_${PROJECT_NAME})

 # tarball
 set(TARBALL "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-${LAST_RELEASE}.tar")

-add_custom_target(tarball-create
+add_custom_target(tarball-create_${PROJECT_NAME}
   COMMAND ${GIT_EXECUTABLE} archive --worktree-attributes
     --prefix ${PROJECT_NAME}-${LAST_RELEASE}/ -o ${TARBALL}
     ${LAST_RELEASE}
@@ -131,19 +131,19 @@
   )

 if(GZIP_EXECUTABLE)
-  add_custom_target(tarball
+  add_custom_target(tarball_${PROJECT_NAME}
     COMMAND ${CMAKE_COMMAND} -E remove ${TARBALL}.gz
     COMMAND ${GZIP_EXECUTABLE} ${TARBALL}
-    DEPENDS tarball-create
+    DEPENDS tarball-create_${PROJECT_NAME}
     WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
     COMMENT "Compressing ${TARBALL}.gz"
   )
   set(TARBALL_GZ "${TARBALL}.gz")
 else()
-  add_custom_target(tarball DEPENDS tarball-create)
+  add_custom_target(tarball_${PROJECT_NAME} DEPENDS tarball-create_${PROJECT_NAME})
 endif()

-set(_gittargets_TARGETS branch cut tag erase tarball tarball-create)
+set(_gittargets_TARGETS branch_${PROJECT_NAME} cut_${PROJECT_NAME} tag_${PROJECT_NAME} erase_${PROJECT_NAME} tarball_${PROJECT_NAME} tarball-create_${PROJECT_NAME})
 foreach(_gittargets_TARGET ${_gittargets_TARGETS})
   set_target_properties(${_gittargets_TARGET} PROPERTIES EXCLUDE_FROM_ALL ON)
   set_target_properties(${_gittargets_TARGET} PROPERTIES FOLDER "git")


Reactivate SLICER_USE_NUMPY to ON

Reactivate SLICER_USE_NUMPY to ON

It was deactivated by error in 761ff2a4f1f.
It caused the modules to fail loading.

--- CMake/Superbuild/External_Slicer.cmake
+++ CMake/Superbuild/External_Slicer.cmake
@@ -123,7 +123,7 @@
       -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=OFF
       -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF
       -DSlicer_USE_SimpleITK:BOOL=OFF
-      -DSlicer_USE_NUMPY:BOOL=OFF
+      -DSlicer_USE_NUMPY:BOOL=ON
       # Slicer built-in modules
       -DSlicer_CLIMODULES_DISABLED:STRING=${Slicer_CLIMODULES_DISABLED}
       -DSlicer_QTLOADABLEMODULES_DISABLED:STRING=${Slicer_QTLOADABLEMODULES_DISABLED}


ManageFile: update comment

ManageFile: update comment

--- Modules/ManageFile.cmake
+++ Modules/ManageFile.cmake
@@ -1,9 +1,8 @@
 # - Manage files
 #
 # Included Modules:
-# - ManageMessage
-# - ManageVariable
-#
+#   - ManageMessage
+#   - ManageVariable
 #
 # Defines following functions:
 #   FIND_FILE_ERROR_HANDLING(<var>
@@ -14,7 +13,7 @@
 #     )
 #     - Find a file, with proper error handling.
 #       It is essentially a wrapper of FIND_FILE
-#       * Parameter:
+#       * Parameters:
 #         + var: The variable that stores the path of the found program.
 #         + name: The filename of the command.
 #         + verboseLevel: See ManageMessage for semantic of
@@ -112,7 +111,7 @@
 #     [<files> | FILES <files>] [DEST_SUBDIR <subDir>]
 #     [RENAME <newName>] [ARGS <args>]
 #     )
-#     - (Deprecated) Manage file installation .
+#     - (Deprecated) Manage file installation.
 #       You can use cmake built-in INSTALL after cmake-fedora-2.0.0
 #       * Parameters:
 #         + fileType: Type of files. Valid values:
@@ -123,7 +122,6 @@
 #         + files: Files to be installed.
 #         + RENAME newName: Destination filename.
 #         + ARGS args: Arguments for INSTALL.
-#
 #

 IF(DEFINED _MANAGE_FILE_CMAKE_)


Added all new source files to CMake system.

--- CMake/SourceFiles.cmake
+++ CMake/SourceFiles.cmake
@@ -27,34 +27,48 @@
   )

 SET (IRRIMGUI_PUBLIC_HEADER_FILES
+	includes/IrrIMGUI/Inject/IrrIMGUIInject.h
+	includes/IrrIMGUI/UnitTest/IIMGUIHandleMock.h
+	includes/IrrIMGUI/UnitTest/IncludeCppUTest.h
+	includes/IrrIMGUI/UnitTest/MockHelper.h
+	includes/IrrIMGUI/UnitTest/UnitTest.h
 	includes/IrrIMGUI/CCharFifo.h
 	includes/IrrIMGUI/CIMGUIEventReceiver.h
 	includes/IrrIMGUI/CIMGUIEventStorage.h
-	includes/IrrIMGUI/CIMGUIHandle.h
-	includes/IrrIMGUI/IrrIMGUI.h
+	includes/IrrIMGUI/IGUITexture.h
+	includes/IrrIMGUI/IIMGUIHandle.h
+	includes/IrrIMGUI/IMGUIHelper.h
+	includes/IrrIMGUI/IncludeIMGUI.h
+	includes/IrrIMGUI/IncludeIrrlicht.h
+	includes/IrrIMGUI/IReferenceCounter.h
+	includes/IrrIMGUI/IrrIMGUI.h
+	includes/IrrIMGUI/IrrIMGUIConfig.h
+	includes/IrrIMGUI/IrrIMGUIConstants.h
 	includes/IrrIMGUI/IrrIMGUIDebug.h
 	includes/IrrIMGUI/SIMGUISettings.h
-	includes/IrrIMGUI/IncludeIrrlicht.h
-	includes/IrrIMGUI/IncludeIMGUI.h
-	includes/IrrIMGUI/IrrIMGUIConfig.h
-	includes/IrrIMGUI/IGUITexture.h
 )

 SET (IRRIMGUI_PRIVATE_HEADER_FILES
+	source/private/CGUITexture.h
+	source/private/IrrIMGUIDebug_priv.h
+	source/private/IrrIMGUIInject_priv.h
+	source/CIMGUIHandle.h
+	source/CIrrlichtIMGUIDriver.h
 	source/COpenGLIMGUIDriver.h
 	source/IIMGUIDriver.h
-	source/IrrIMGUIDebug_priv.h
-	source/CGUITexture.h
-	source/CIrrlichtIMGUIDriver.h
 )

 SET (IRRIMGUI_SOURCE_FILES
 	source/CChannelBuffer.cpp
 	source/CCharFifo.cpp
+	source/CGUITexture.cpp
 	source/CIMGUIEventReceiver.cpp
 	source/CIMGUIHandle.cpp
+	source/CIrrlichtIMGUIDriver.cpp
 	source/COpenGLIMGUIDriver.cpp
 	source/IIMGUIDriver.cpp
-	source/CGUITexture.cpp
-	source/CIrrlichtIMGUIDriver.cpp
+	source/IMGUIHelper.cpp
+	source/IReferenceCounter.cpp
+	source/IrrIMGUIInject.cpp
+	source/UnitTest.cpp
 )


ENH: Add link to bugtracking

ENH: Add link to bugtracking

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -24,6 +24,8 @@
 SET (CVS_WEB_CVSROOT "Xdmf")
 #SET (DOXYGEN_URL "http://${DROP_SITE}/" )
 #SET (GNATS_WEB_URL "http://${DROP_SITE}/")
+SET (GNATS_WEB_URL "http://public.kitware.com/Bug/bug.php")
+SET (USE_GNATS "On")

 # copy over the testing logo
 #CONFIGURE_FILE(${PARAVIEW_SOURCE_DIR}/Web/Art/ParaViewLogo.gif ${PARAVIEW_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)


[FIX] Using default dependencies for find_package(SeqAn) for apps in legacy build system.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@13403 e6417c60-b987-48fd-844e-b20f0fcc1017


Documentation typos

Documentation typos

--- CommonLibrary.cmake
+++ CommonLibrary.cmake
@@ -8,11 +8,11 @@
 # * NAME_SOURCES for all compilation units
 # * NAME_HEADERS for all internal header files
 # * NAME_PUBLIC_HEADERS for public, installed header files
-# * NAME_PUBLIC_INCLUDE_DIRECTORIES for transient dependencies of name which are
-#   not targets (e.g. Boost_INCLUDE_DIRS).
+# * NAME_PUBLIC_INCLUDE_DIRECTORIES for transitive dependencies of name which
+#   are not targets (e.g. Boost_INCLUDE_DIRS).
 # * NAME_LINK_LIBRARIES for dependencies of name. Use targets rather than
-#   NAME_LIBRARIES variable. Also use PUBLIC and PRIVATE for declaring transient
-#   dependencies for export target generation.
+#   NAME_LIBRARIES variable. Also use PUBLIC and PRIVATE for declaring
+#   transitive dependencies for export target generation.
 # * NAME_LIBRARY_TYPE or COMMON_LIBRARY_TYPE for SHARED or STATIC library, with
 #   COMMON_LIBRARY_TYPE being an option stored in the CMakeCache.
 # * NAME_OMIT_LIBRARY_HEADER when set, no library header (name.h) is generated.


removed server cache restriction of meta files

now it is possible to use also nexus as cache server, not only github

--- cmake/modules/hunter_download_cache_meta_file.cmake
+++ cmake/modules/hunter_download_cache_meta_file.cmake
@@ -65,19 +65,20 @@
     foreach(server ${HUNTER_CACHE_SERVERS})
       string(REGEX MATCH "^https://github.com/" is_github "${server}")
       if(NOT is_github)
-        hunter_user_error("Unknown cache server: ${server}")
+        set(local_url "${server}/meta/${local_suffix}")
+        set(done_url "${server}/meta/${done_suffix}")
+      else()
+        string(
+            REPLACE
+            "https://github.com/"
+            "https://raw.githubusercontent.com/"
+            url
+            "${server}"
+        )
+
+        set(local_url "${url}/master/${local_suffix}")
+        set(done_url "${url}/master/${done_suffix}")
       endif()
-
-      string(
-          REPLACE
-          "https://github.com/"
-          "https://raw.githubusercontent.com/"
-          url
-          "${server}"
-      )
-
-      set(local_url "${url}/master/${local_suffix}")
-      set(done_url "${url}/master/${done_suffix}")

       hunter_status_debug("Downloading file (try #${x} of ${total_retry}):")
       hunter_status_debug("  ${done_url}")


Travis CI: trying to address an issue with Homebrew building Qt 5.5 with no rpath.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -1044,10 +1044,10 @@
 MESSAGE("---------[${PROJECT_TARGET}]---------")

         FOREACH(QT_LIBRARY ${OS_X_QT_LIBRARIES})
+            SET(QT_LIBRARY_FILENAME ${QT_LIBRARY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_LIBRARY})
 MESSAGE("===> ${QT_LIBRARY}")
 MESSAGE("     ${QT_LIBRARY_DIR}/${QT_LIBRARY_FILENAME} ---> @rpath/${QT_LIBRARY_FILENAME}")
 MESSAGE("     ${REAL_QT_LIBRARY_DIR}/${QT_LIBRARY_FILENAME} ---> @rpath/${QT_LIBRARY_FILENAME}")
-            SET(QT_LIBRARY_FILENAME ${QT_LIBRARY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_LIBRARY})

             ADD_CUSTOM_COMMAND(TARGET ${PROJECT_TARGET} POST_BUILD
                                COMMAND install_name_tool -change ${QT_LIBRARY_DIR}/${QT_LIBRARY_FILENAME}


more logic error fixes for KNL CMake configuration

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -48,7 +48,7 @@

 ## Macro check for compiler support of ISA ##
 MACRO(OSPRAY_CHECK_COMPILER_SUPPORT ISA)
-  IF (${ISA} STREQUAL "AVX512" AND NOT OSPRAY_COMPILER_ICC AND (WIN32 OR APPLE))
+  IF (${ISA} STREQUAL "AVX512" AND (NOT OSPRAY_COMPILER_ICC OR WIN32 OR APPLE))
     OSPRAY_WARN_ONCE(MISSING_AVX512 "OSPRay Currently requires ICC on Linux for KNL support. Disabling KNL ISA target.")
     SET(OSPRAY_EMBREE_ENABLE_${ISA} false)
   ELSEIF (OSPRAY_EMBREE_ENABLE_${ISA} AND NOT OSPRAY_COMPILER_SUPPORTS_${ISA})


Only add Eigen_INCLUDE_DIR to cache vars if actually set

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -321,6 +321,12 @@
        -DPYTHON_INCLUDE_DIR2:PATH=${PYTHON_INCLUDE_DIR2}
        -DMITK_USE_SYSTEM_PYTHON:BOOL=${MITK_USE_SYSTEM_PYTHON}
       )
+endif()
+
+if(Eigen_INCLUDE_DIR)
+    list(APPEND mitk_optional_cache_args
+      -DEigen_INCLUDE_DIR:PATH=${Eigen_INCLUDE_DIR}
+    )
 endif()

 set(proj MITK-Configure)
@@ -387,7 +393,6 @@
     -DBOOST_ROOT:PATH=${BOOST_ROOT}
     -DBOOST_LIBRARYDIR:PATH=${BOOST_LIBRARYDIR}
     -DMITK_USE_Boost_LIBRARIES:STRING=${MITK_USE_Boost_LIBRARIES}
-    -DEigen_INCLUDE_DIR:PATH=${Eigen_INCLUDE_DIR}
   CMAKE_ARGS
     ${mitk_initial_cache_arg}
     ${MAC_OSX_ARCHITECTURE_ARGS}


Superbuild - Fix CTK-Build step

Superbuild - Fix CTK-Build step

In ExternalProject.cmake, when using ExternalProject_Add, if the
command associated with the build step is not specified. One is generated
based on the configure command. In our case, since the configure
command had been explicitly disabled (set to an empty string), the build
command was then defaulting to 'make'.

Let's add a dummy configure step so that BUILD_COMMAND is properly setup.

For more details, see _ep_get_configure_command_id
and _ep_get_build_command in ExternalProject.cmake

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -258,9 +258,11 @@
 #MESSAGE(STATUS SUPERBUILD_EXCLUDE_CTKBUILD_TARGET:${SUPERBUILD_EXCLUDE_CTKBUILD_TARGET})
 IF(NOT DEFINED SUPERBUILD_EXCLUDE_CTKBUILD_TARGET OR NOT SUPERBUILD_EXCLUDE_CTKBUILD_TARGET)
   SET(proj CTK-build)
+  # Note: Let's add a dummy configure step so that BUILD_COMMAND is properly setup.
+  #       See _ep_get_configure_command_id and _ep_get_build_command in ExternalProject.cmake
   ExternalProject_Add(${proj}
     DOWNLOAD_COMMAND ""
-    CONFIGURE_COMMAND ""
+    CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo_append
     CMAKE_GENERATOR ${gen}
     SOURCE_DIR ${CTK_SOURCE_DIR}
     BINARY_DIR CTK-build


Fixed Bug 879141 - Excessive quotation mark for target tag_pre

--- Modules/ManageSourceVersionControl.cmake
+++ Modules/ManageSourceVersionControl.cmake
@@ -64,7 +64,9 @@

 	ADD_CUSTOM_COMMAND(OUTPUT ${MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE}
 	    COMMAND make tag_pre
-	    COMMAND git commit --short -uno > ${CMAKE_FEDORA_TMP_DIR}/git-status || echo "Is source committed?"
+	    COMMAND git commit --short -uno > "${CMAKE_FEDORA_TMP_DIR}/git-status"
+	    COMMAND echo "Is Source committed?"
+	    COMMAND if [ -s "${CMAKE_FEDORA_TMP_DIR}/git-status" ] ; then
 	    COMMAND test ! -s "${CMAKE_FEDORA_TMP_DIR}/git-status"
 	    COMMAND git tag -a -m "${CHANGE_SUMMARY}" "${PRJ_VER}" HEAD
 	    COMMENT "Tagging the source as ver ${PRJ_VER}"


Specify the build type as an argument in ctest

Required for Windows systems.

--- CommonCPPCTest.cmake
+++ CommonCPPCTest.cmake
@@ -109,12 +109,12 @@
   endif()
 else()
   add_custom_target(${PROJECT_NAME}_cpptests
-    COMMAND ${CMAKE_CTEST_COMMAND} -E '^.*perf_.*' \${ARGS}
+    COMMAND ${CMAKE_CTEST_COMMAND} -E '^.*perf_.*' -C $<CONFIGURATION> \${ARGS}
     DEPENDS ${ALL_CPP_TESTS}
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "Running all ${PROJECT_NAME} cpp tests")
   add_custom_target(${PROJECT_NAME}_perftests
-    COMMAND ${CMAKE_CTEST_COMMAND} -R '^.*perf_.*' \${ARGS}
+    COMMAND ${CMAKE_CTEST_COMMAND} -R '^.*perf_.*' -C $<CONFIGURATION> \${ARGS}
     DEPENDS ${ALL_CPP_PERF_TESTS}
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "Running all ${PROJECT_NAME} performance tests")


Fix missing Darwin compile defintion

Fix missing Darwin compile defintion

--- CommonCompiler.cmake
+++ CommonCompiler.cmake
@@ -188,6 +188,9 @@
       set_property(TARGET ${Name} PROPERTY CXX_STANDARD 11)
     endif()
     target_compile_features(${Name} ${__visibility} ${COMMON_CXX11_FEATURES})
+  endif()
+  if(APPLE)
+    target_compile_definitions(${Name} ${__visibility} Darwin)
   endif()
   if(NOT __interface)
     if(CMAKE_VERSION VERSION_LESS 3.3 OR MSVC)


Fix cpplint for subprojects (based on cppcheck targets.)

--- CpplintTargets.cmake
+++ CpplintTargets.cmake
@@ -24,8 +24,8 @@
 endif(NOT CPPLINT_FOUND)

 if(NOT CPPLINT_FOUND)
-  add_custom_target(cpplint COMMENT "${CPPLINT_NOT_FOUND_MSG}")
-  set_target_properties(cpplint PROPERTIES EXCLUDE_FROM_ALL TRUE)
+  add_custom_target(cpplint_${PROJECT_NAME} COMMENT "${CPPLINT_NOT_FOUND_MSG}")
+  set_target_properties(cpplint_${PROJECT_NAME} PROPERTIES EXCLUDE_FROM_ALL TRUE)
 endif(NOT CPPLINT_FOUND)

 if(NOT TARGET cpplint)
@@ -40,77 +40,84 @@
     message(FATAL_ERROR
       "add_cpplint is given a target name that does not exist: '${_name}' !")
   endif()
-  if(CPPLINT_FOUND)
-    set(_cpplint_args)
+  if(NOT CPPLINT_FOUND)
+    return()
+  endif( )

-    # handles category filters
-    set(_category_filter)
-    set(_category_filter_in "+build,+legal,+readability,+runtime,+whitespace")
-    if (add_cpplint_CATEGORY_FILTER_OUT)
-      string(REPLACE ";" ",-" add_cpplint_CATEGORY_FILTER_OUT "${add_cpplint_CATEGORY_FILTER_OUT}")
-      set(_category_filter "--filter=${_category_filter_in},-${add_cpplint_CATEGORY_FILTER_OUT}")
-    endif(add_cpplint_CATEGORY_FILTER_OUT)
-    list(APPEND _cpplint_args ${_category_filter})
+  set(_cpplint_args)

-    # handles allowed extensions
-    if (add_cpplint_EXTENSIONS)
-      string(REPLACE ";" "," add_cpplint_EXTENSIONS "${add_cpplint_EXTENSIONS}")
-      set(add_cpplint_EXTENSIONS "--extensions=${add_cpplint_EXTENSIONS}")
-      list(APPEND _cpplint_args ${add_cpplint_EXTENSIONS})
-    endif(add_cpplint_EXTENSIONS)
+  # handles category filters
+  set(_category_filter)
+  set(_category_filter_in "+build,+legal,+readability,+runtime,+whitespace")
+  if (add_cpplint_CATEGORY_FILTER_OUT)
+    string(REPLACE ";" ",-" add_cpplint_CATEGORY_FILTER_OUT "${add_cpplint_CATEGORY_FILTER_OUT}")
+    set(_category_filter "--filter=${_category_filter_in},-${add_cpplint_CATEGORY_FILTER_OUT}")
+  endif(add_cpplint_CATEGORY_FILTER_OUT)
+  list(APPEND _cpplint_args ${_category_filter})

-    # handles verbosity level ([0-5])
-    if (add_cpplint_VERBOSE)
-      list(APPEND _cpplint_args "--verbose=${add_cpplint_VERBOSE}")
-    endif(add_cpplint_VERBOSE)
+  # handles allowed extensions
+  if (add_cpplint_EXTENSIONS)
+    string(REPLACE ";" "," add_cpplint_EXTENSIONS "${add_cpplint_EXTENSIONS}")
+    set(add_cpplint_EXTENSIONS "--extensions=${add_cpplint_EXTENSIONS}")
+    list(APPEND _cpplint_args ${add_cpplint_EXTENSIONS})
+  endif(add_cpplint_EXTENSIONS)

-    # handles counting level of detail (total|toplevel|detailed)
-    if (add_cpplint_COUNTING)
-      list(APPEND _cpplint_args "--counting=${add_cpplint_COUNTING}")
-    endif(add_cpplint_COUNTING)
+  # handles verbosity level ([0-5])
+  if (add_cpplint_VERBOSE)
+    list(APPEND _cpplint_args "--verbose=${add_cpplint_VERBOSE}")
+  endif(add_cpplint_VERBOSE)

-    # handles root directory used for deriving header guard CPP variable
-    if(add_cpplint_ROOT)
-      list(APPEND _cpplint_args "--root=${add_cpplint_ROOT}")
-    endif(add_cpplint_ROOT)
+  # handles counting level of detail (total|toplevel|detailed)
+  if (add_cpplint_COUNTING)
+    list(APPEND _cpplint_args "--counting=${add_cpplint_COUNTING}")
+  endif(add_cpplint_COUNTING)

-    # handles line length
-    if (add_cpplint_LINELENGTH)
-      list(APPEND _cpplint_args "--linelength=${add_cpplint_LINELENGTH}")
-    endif(add_cpplint_LINELENGTH)
+  # handles root directory used for deriving header guard CPP variable
+  if(add_cpplint_ROOT)
+    list(APPEND _cpplint_args "--root=${add_cpplint_ROOT}")
+  endif(add_cpplint_ROOT)

-    get_target_property(_imported_target "${_name}" IMPORTED)
-    if(_imported_target)
-      return()
+  # handles line length
+  if (add_cpplint_LINELENGTH)
+    list(APPEND _cpplint_args "--linelength=${add_cpplint_LINELENGTH}")
+  endif(add_cpplint_LINELENGTH)
+
+  get_target_property(_imported_target "${_name}" IMPORTED)
+  if(_imported_target)
+    return()
+  endif()
+
+  get_target_property(_cpplint_sources "${_name}" SOURCES)
+  set(_files)
+  #set(_exclude_pattern ".*moc_.*\\.cxx|Buildyard/Build")
+  foreach(_source ${_cpplint_sources})
+    get_source_file_property(_cpplint_lang "${_source}" LANGUAGE)
+    get_source_file_property(_cpplint_loc "${_source}" LOCATION)
+    if("${_cpplint_lang}" MATCHES "CXX" AND NOT ${_cpplint_loc} MATCHES ${add_cpplint_EXCLUDE_PATTERN})
+      list(APPEND _files "${_cpplint_loc}")
     endif()
+  endforeach()

-    get_target_property(_cpplint_sources "${_name}" SOURCES)
-    set(_files)
-    #set(_exclude_pattern ".*moc_.*\\.cxx|Buildyard/Build")
-    foreach(_source ${_cpplint_sources})
-      get_source_file_property(_cpplint_lang "${_source}" LANGUAGE)
-      get_source_file_property(_cpplint_loc "${_source}" LOCATION)
-      if("${_cpplint_lang}" MATCHES "CXX" AND NOT ${_cpplint_loc} MATCHES ${add_cpplint_EXCLUDE_PATTERN})
-        list(APPEND _files "${_cpplint_loc}")
-      endif("${_cpplint_lang}" MATCHES "CXX" AND NOT ${_cpplint_loc} MATCHES ${add_cpplint_EXCLUDE_PATTERN})
-    endforeach(_source ${_cpplint_sources})
+  if(NOT _files) # nothing to check
+    return()
+  endif(NOT _files)

-    if(NOT _files) # nothing to check
-      return()
-    endif(NOT _files)
+  if(CPPLINT_ADD_TESTS)
+    add_test(NAME cpplint_test_${_name}
+      COMMAND "${CPPLINT_SCRIPT}" ${_files})
+    set_tests_properties(cpplint_test_${_name}
+      PROPERTIES PASS_REGULAR_EXPRESSION "Total errors found: 0")
+  endif()

-    if(CPPLINT_ADD_TESTS)
-      add_test(NAME ${_name}_cpplint_test
-        COMMAND "${CPPLINT_SCRIPT}" ${_files})
-      set_tests_properties(${_name}_cpplint_test
-        PROPERTIES PASS_REGULAR_EXPRESSION "Total errors found: 0")
-    endif()
+  add_custom_target(cpplint_run_${_name}
+    COMMAND ${CPPLINT_SCRIPT} ${_cpplint_args} ${_files}
+    WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
+    COMMENT "cpplint_run_${_name}: Running cpplint on ${_name}"
+    VERBATIM)

-    add_custom_target(${_name}_cpplint
-      COMMAND ${CPPLINT_SCRIPT} ${_cpplint_args} ${_files}
-      WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
-      COMMENT "Running cpplint on ${_name}"
-      VERBATIM)
-    add_dependencies(cpplint ${_name}_cpplint)
+  if(NOT TARGET cpplint_${PROJECT_NAME})
+    add_custom_target(cpplint_${PROJECT_NAME})
   endif()
+  add_dependencies(cpplint_${PROJECT_NAME} cpplint_run_${_name})
+  add_dependencies(cpplint cpplint_${PROJECT_NAME})
 endfunction(add_cpplint)


v2.4.11

--- VERSION.cmake
+++ VERSION.cmake
@@ -44,10 +44,10 @@
 #    set COMPATMINOR to MINOR. (binary incompatible change)
 #

-# Package version 2.4.9
+# Package version 2.4.11
 SET(OPENWSMAN_MAJOR "2")
 SET(OPENWSMAN_MINOR "4")
-SET(OPENWSMAN_PATCH "10")
+SET(OPENWSMAN_PATCH "11")

 # Plugin API 2.2
 SET(OPENWSMAN_PLUGIN_API_MAJOR "2")


Put combined debug/optimized libs in CMakeCache.

--- cmake/BALLMacros.cmake
+++ cmake/BALLMacros.cmake
@@ -204,11 +204,11 @@
 	SET(OPTIMIZED_LIBS "${OPTIMIZED_LIBS}")
 	SET(DEBUG_LIBS "${DEBUG_LIBS}")
 	IF (OPTIMIZED_LIBS AND DEBUG_LIBS)
-		SET(${RESULT} optimized "${OPTIMIZED_LIBS}" debug "${DEBUG_LIBS}")
+		SET(${RESULT} optimized "${OPTIMIZED_LIBS}" debug "${DEBUG_LIBS}" CACHE STRING "" FORCE)
 	ELSEIF(OPTIMIZED_LIBS)
-		SET(${RESULT} "${OPTIMIZED_LIBS}")
+		SET(${RESULT} "${OPTIMIZED_LIBS}" CACHE STRING ${RESULT} FORCE)
 	ELSEIF(DEBUG_LIBS)
-		SET(${RESULT} "${DEBUG_LIBS}")
+		SET(${RESULT} "${DEBUG_LIBS}" CACHE STRING ${RESULT} FORCE)
 	ENDIF()
 ENDMACRO()


cmake: improved DTC detection handling

cmake: improved DTC detection handling

Fixes: #26096

In some cases DTC may be installed, but in a non-working state.
In such cases, CMake will abort processing with an cryptic error.

This commit now handles dtc version errors and print a warning., and
CMake processing continues.

dtc is an optional component and failures should not break CMake run.

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

--- cmake/host-tools.cmake
+++ cmake/host-tools.cmake
@@ -59,17 +59,26 @@
     COMMAND
     ${DTC} --version
     OUTPUT_VARIABLE dtc_version_output
+    ERROR_VARIABLE  dtc_error_output
+    RESULT_VARIABLE dtc_status
     )
-  string(REGEX MATCH "Version: DTC ([0-9]+[.][0-9]+[.][0-9]+).*" out_var ${dtc_version_output})

-  # Since it is optional, an outdated version is not an error. If an
-  # outdated version is discovered, print a warning and proceed as if
-  # DTC were not installed.
-  if(${CMAKE_MATCH_1} VERSION_GREATER ${MIN_DTC_VERSION})
-    message(STATUS "Found dtc: ${DTC} (found suitable version \"${CMAKE_MATCH_1}\", minimum required is \"${MIN_DTC_VERSION}\")")
+  if(${dtc_status} EQUAL 0)
+    string(REGEX MATCH "Version: DTC ([0-9]+[.][0-9]+[.][0-9]+).*" out_var ${dtc_version_output})
+
+    # Since it is optional, an outdated version is not an error. If an
+    # outdated version is discovered, print a warning and proceed as if
+    # DTC were not installed.
+    if(${CMAKE_MATCH_1} VERSION_GREATER ${MIN_DTC_VERSION})
+      message(STATUS "Found dtc: ${DTC} (found suitable version \"${CMAKE_MATCH_1}\", minimum required is \"${MIN_DTC_VERSION}\")")
+    else()
+      message(WARNING
+        "Could NOT find dtc: Found unsuitable version \"${CMAKE_MATCH_1}\", but required is at least \"${MIN_DTC_VERSION}\" (found ${DTC}). Optional devicetree error checking with dtc will not be performed.")
+      set(DTC DTC-NOTFOUND)
+    endif()
   else()
     message(WARNING
-      "Could NOT find dtc: Found unsuitable version \"${CMAKE_MATCH_1}\", but required is at least \"${MIN_DTC_VERSION}\" (found ${DTC}). Optional devicetree error checking with dtc will not be performed.")
+      "Could NOT find working dtc: Found dtc (${DTC}), but failed to load with:\n ${dtc_error_output}")
     set(DTC DTC-NOTFOUND)
   endif()
 endif()


Adding OUTPUT_QUIET to both checkouts.

Adding OUTPUT_QUIET to both checkouts.

--- CPM.cmake
+++ CPM.cmake
@@ -417,6 +417,7 @@
         COMMAND "${GIT_EXECUTABLE}" checkout ${_CPM_GIT_TAG}
         WORKING_DIRECTORY "${__CPM_MODULE_SOURCE_DIR}"
         RESULT_VARIABLE error_code
+        OUTPUT_QUIET
         )
       if(error_code)
         message(FATAL_ERROR "Failed to checkout tag: '${_CPM_GIT_TAG}'")
@@ -492,7 +493,7 @@
         COMMAND "${GIT_EXECUTABLE}" checkout ${_CPM_GIT_TAG}
         WORKING_DIRECTORY "${__CPM_MODULE_SOURCE_DIR}"
         RESULT_VARIABLE error_code
-        OUTPUT_QUIET TRUE
+        OUTPUT_QUIET
         )
       if(error_code)
         message(FATAL_ERROR "Failed to checkout tag: '${_CPM_GIT_TAG}'")