cmake-unit: Only delete source file write script whilst not not open

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -583,8 +583,7 @@
           "      GENERATED_FILE_CONTENTS)\n"
           "file (WRITE \"${CMAKE_CURRENT_BINARY_DIR}/${NAME}\"\n"
           "      \"\${GENERATED_FILE_CONTENTS}\")\n"
-          "file (REMOVE \"${TMP_BINARY_DIR_LOCATION}\")\n"
-          "file (REMOVE \"${WRITE_SOURCE_FILE_SCRIPT}\")\n")
+          "file (REMOVE \"${TMP_BINARY_DIR_LOCATION}\")\n")

     # Generate target name, convert temporary location to lowercase.
@@ -594,8 +593,17 @@
     add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${NAME}"
                         COMMAND "${CMAKE_COMMAND}" -P
                         "${WRITE_SOURCE_FILE_SCRIPT}")
-    add_custom_target (${TARGET_NAME} ALL
+    add_custom_target (${TARGET_NAME}
                        SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}")
+
+    add_custom_target (${TARGET_NAME}_cleanup ALL
+                       COMMAND
+                       "${CMAKE_COMMAND}"
+                       -E
+                       remove
+                       -f
+                       "${WRITE_SOURCE_FILE_SCRIPT}")
+    add_dependencies (${TARGET_NAME}_cleanup ${TARGET_NAME})

     set (${TARGET_RETURN} "${TARGET_NAME}" PARENT_SCOPE)


Fix hdf5 library names for VTK (and ParaView).

Change-Id: I6686578b7255f164f51d7250116978f099ef373c

--- ThirdParty/hdf5/vtkhdf5/config/cmake/HDFMacros.cmake
+++ ThirdParty/hdf5/vtkhdf5/config/cmake/HDFMacros.cmake
@@ -75,7 +75,12 @@

 #-------------------------------------------------------------------------------
 MACRO (HDF_SET_LIB_OPTIONS libtarget _libname libtype)
-  set (libname "${_libname}${VTK_CUSTOM_LIBRARY_SUFFIX}")
+  if(DEFINED VTK_CUSTOM_LIBRARY_SUFFIX)
+    set(_lib_suffix "${VTK_CUSTOM_LIBRARY_SUFFIX}")
+  else()
+    set(_lib_suffix "-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
+  endif()
+  set (libname "${_libname}${_lib_suffix}")
   # message (STATUS "${libname} libtype: ${libtype}")
   # We don't mangle library names based on build type or platform.
   set (LIB_RELEASE_NAME "${libname}")


Also search in ENV variables for likwid

Also search in ENV variables for likwid

--- cmake/FindLikwid.cmake
+++ cmake/FindLikwid.cmake
@@ -28,8 +28,8 @@
   set (LIKWID_FIND_QUIETLY TRUE)
 endif (LIKWID_LIBRARIES AND LIKWID_INCLUDE_DIRS)

-find_path(LIKWID_INCLUDE_DIRS NAMES likwid.h HINTS ${LIKWID_INC} ${LIKWID_ROOT} PATH_SUFFIXES include)
-find_library(LIKWID_LIBRARIES NAMES liblikwid.so HINTS ${LIKWID_LIB} ${LIKWID_ROOT} PATH_SUFFIXES lib lib64)
+find_path(LIKWID_INCLUDE_DIRS NAMES likwid.h HINTS ${LIKWID_INC} ${LIKWID_ROOT} ENV INCLUDE ENV C_INCLUDE_PATH PATH_SUFFIXES include)
+find_library(LIKWID_LIBRARIES NAMES liblikwid.so HINTS ${LIKWID_LIB} ${LIKWID_ROOT} ENV LD_LIBRARY_PATH ENV LIBRARY_PATH PATH_SUFFIXES lib lib64)

 include (FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Likwid DEFAULT_MSG


Fixed Win64 determination in FindOpenCL.cmake

refs kylelutz/compute#7

--- cmake/FindOpenCL.cmake
+++ cmake/FindOpenCL.cmake
@@ -31,11 +31,11 @@
     IF (WIN32)
 	# The AMD SDK currently installs both x86 and x86_64 libraries
 	# This is only a hack to find out architecture
-	IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
+	IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
 	    SET(OPENCL_LIB_DIR "$ENV{AMDAPPSDKROOT}/lib/x86_64")
-	ELSE (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
+	ELSE( CMAKE_SIZEOF_VOID_P EQUAL 8 )
 	    SET(OPENCL_LIB_DIR "$ENV{AMDAPPSDKROOT}/lib/x86")
-	ENDIF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
+	ENDIF( CMAKE_SIZEOF_VOID_P EQUAL 8 )

 	FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib PATHS
 	    ${OPENCL_LIB_DIR} $ENV{OpenCL_LIBPATH} $ENV{CUDA_LIB_PATH})


remove unwanted spaces

remove unwanted spaces

--- cmake/FindRadium.cmake
+++ cmake/FindRadium.cmake
@@ -60,7 +60,7 @@
         FIND_LIBRARY ( ASSIMP_LIBRARIES
             NAMES assimp assimpd
             PATHS ${RADIUM_ROOT_DIR}/${CMAKE_BUILD_TYPE}/3rdPartyLibraries/lib
-            )
+            )
     ENDIF (NOT ASSIMP_LIBRARIES)

     IF(NOT ASSIMP_INCLUDE_DIR)


Include the license in the cmake module

Include the license in the cmake module

--HG--
branch : no_ign_msgs_findzmq

--- cmake/FindZeroMQ.cmake
+++ cmake/FindZeroMQ.cmake
@@ -1,15 +1,39 @@
 ##=============================================================================
-##
-##  Copyright (c) Kitware, Inc.
-##  All rights reserved.
-##  See LICENSE.txt for details.
-##
-##  This software is distributed WITHOUT ANY WARRANTY; without even
-##  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-##  PURPOSE.  See the above copyright notice for more information.
-##
-##  Modified by Joser Luis Rivero <jrivero@osrfoundation.org>
-##
+#
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+# nor the names of their contributors may be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#  Modified by Jose Luis Rivero <jrivero@osrfoundation.org>
+#
 ##=============================================================================
 # - Try to find ZeroMQ headers and libraries
 #


Attempt to mask warnings caused by the fix for cuda 3.2 installed on system dirs

--- cmake/nvcc-check.cmake
+++ cmake/nvcc-check.cmake
@@ -64,7 +64,7 @@
   ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCC)

-  IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR "APPLE")
+  IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "APPLE")
       # For CUDA 3.2: surface_functions.h does some non-compliant things...
       #               so we tell g++ to ignore them when called via nvcc
       #               by passing the -fpermissive flag through the nvcc
@@ -73,12 +73,12 @@
       #               valid... resulting in TONS of warnings.  So, we go
       #               version checking again, this time nvcc...
       # Get the nvcc version number
-
-      IF(CUDA_VERSION_MAJOR MATCHES "3")
-          IF(CUDA_VERSION_MINOR MATCHES "2")
-              SET (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --compiler-options='-fpermissive')
-              MESSAGE(STATUS "nvcc-check: CUDA 3.2 exception: CUDA_NVCC_FLAGS set to \"${CUDA_NVCC_FLAGS}\"")
-          ENDIF()
+
+      # This issue seems to be only if cuda is installed in system so test CUDA_INCLUDE_DIRS
+      # (see http://nvidia.custhelp.com/app/answers/detail/a_id/2869/~/linux-based-cuda-v3.x-compiler-issue-affecting-cuda-surface-apis)
+      IF(CUDA_VERSION_MAJOR MATCHES "3" AND CUDA_VERSION_MINOR MATCHES "2" AND CUDA_INCLUDE_DIRS MATCHES "/usr/include")
+          SET (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --compiler-options='-fpermissive')
+          MESSAGE(STATUS "nvcc-check: CUDA 3.2 exception: CUDA_NVCC_FLAGS set to \"${CUDA_NVCC_FLAGS}\"")
       ENDIF()
   ENDIF()
 ENDIF(CUDA_FOUND)


adding prefix -l to openblas libs, thus the linker flags from ALL_MATH_LIBS are in the correct format

--- cmake/tests/Math.cmake
+++ cmake/tests/Math.cmake
@@ -64,7 +64,13 @@
   if(NOT EL_DISABLE_OPENBLAS)
     include(openblas)
     if(EL_HAVE_OPENBLAS)
-      set(MATH_LIBS ${OPENBLAS_LIBS})
+      foreach(NAME ${OPENBLAS_LIBS})
+	if(${NAME} STREQUAL "gfortran" OR ${NAME} STREQUAL "pthread" OR ${NAME} STREQUAL "m")
+	  list(APPEND MATH_LIBS "-l${NAME}")
+	else()
+	  list(APPEND MATH_LIBS "${NAME}")
+	endif()
+      endforeach()
       message("Will use OpenBLAS via MATH_LIBS=${MATH_LIBS}")
     endif()
   endif()


FindSodium: Do not create target unconditionally (#430)

Summary:
This fixes  https://github.com/facebook/fbthrift/issues/429

Pull Request resolved: https://github.com/facebook/fbthrift/pull/430

Reviewed By: iahs

Differential Revision: D28832985

Pulled By: vitaut

fbshipit-source-id: 0719f27207d11bb7970cc43c621640c425d8f55d

--- build/fbcode_builder/CMake/FindSodium.cmake
+++ build/fbcode_builder/CMake/FindSodium.cmake
@@ -254,7 +254,10 @@
 else()
     set(_LIB_TYPE SHARED)
 endif()
-add_library(sodium ${_LIB_TYPE} IMPORTED)
+
+if(NOT TARGET sodium)
+    add_library(sodium ${_LIB_TYPE} IMPORTED)
+endif()

 set_target_properties(sodium PROPERTIES
     INTERFACE_INCLUDE_DIRECTORIES "${sodium_INCLUDE_DIR}"


Add Solaris sparc  Sun Studio flags

Add Solaris sparc  Sun Studio flags

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -73,18 +73,29 @@
     IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
       IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
         IF(CMAKE_SIZEOF_VOIDP EQUAL 4)
-          # 32 bit - optinmization is -xO2
+          # Solaris x86
           SET(CMAKE_C_FLAGS_RELWITHDEBINFO
             "-g -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
           SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
             "-g0 -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
         ELSE()
-          # 64 bit - optimization is -xO3
+          #  Solaris x64
           SET(CMAKE_C_FLAGS_RELWITHDEBINFO
             "-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
           SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
             "-g0 -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
          ENDIF()
+       ELSE()
+
+          IF(CMAKE_SIZEOF_VOIDP EQUAL 4)
+            # Solaris sparc 32 bit
+            SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-g -xO3 -Xa -xstrconst -mt -xarch=sparc")
+            SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt -xarch=sparc")
+          ELSE()
+            # Solaris sparc 64 bit
+            SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-g -xO3 -Xa -xstrconst -mt")
+            SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt")
+          ENDIF()
        ENDIF()
     ENDIF()
   ENDIF()


bug#55250: 5.5.5-m3 incorrectly compiled with exceptions on Solaris/x86

Put '-features=no%except' back into Solaris/x86 CXXFLAGS.

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -194,7 +194,7 @@
     IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
       IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
         SET(COMMON_C_FLAGS                   "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
-        SET(COMMON_CXX_FLAGS                 "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
+        SET(COMMON_CXX_FLAGS                 "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
         SET(CMAKE_C_FLAGS_DEBUG              "${COMMON_C_FLAGS}")
         SET(CMAKE_CXX_FLAGS_DEBUG            "${COMMON_CXX_FLAGS}")
         IF(32BIT)


[Build] Added the macro for Readline dependency.

--- project_config_embeddable.cmake
+++ project_config_embeddable.cmake
@@ -252,6 +252,10 @@
       get_boost (${_arg_version})
     endif (${_arg_lower} STREQUAL "boost")

+    if (${_arg_lower} STREQUAL "readline")
+      get_readline (${_arg_version})
+    endif (${_arg_lower} STREQUAL "readline")
+
     if (${_arg_lower} STREQUAL "mysql")
       get_mysql (${_arg_version})
     endif (${_arg_lower} STREQUAL "mysql")
@@ -333,6 +337,33 @@
   endif (Boost_FOUND)

 endmacro (get_boost)
+
+# ~~~~~~~~~~ Readline ~~~~~~~~~
+macro (get_readline)
+  set (_required_version 0)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires Readline-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires Readline without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  set (READLINE_FOUND False)
+
+  find_package (Readline)
+  if (READLINE_LIBRARY)
+    set (READLINE_FOUND True)
+  endif (READLINE_LIBRARY)
+
+  if (READLINE_FOUND)
+    # Update the list of include directories for the project
+    include_directories (${READLINE_INCLUDE_DIR})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${READLINE_LIBRARY})
+  endif (READLINE_FOUND)
+
+endmacro (get_readline)

 # ~~~~~~~~~~ MySQL ~~~~~~~~~
 macro (get_mysql)
@@ -829,7 +860,7 @@

   # Register the (CMake) target for the executable, and specify the name
   # of that latter
-  add_executable (${_exec_name}bin ${_exec_source_dir}/${MODULE_NAME}.cpp)
+  add_executable (${_exec_name}bin ${_exec_source_dir}/${_exec_name}.cpp)
   set_target_properties (${_exec_name}bin PROPERTIES OUTPUT_NAME ${_exec_name})

   # Register the dependencies on which the binary depends upon
@@ -848,7 +879,7 @@

   # Register, for reporting purpose, the list of executables to be built
   # and installed for that module
-  list (APPEND ${MODULE_NAME}_ALL_EXECS ${PROJ_ALL_BIN_TARGETS})
+  list (APPEND ${MODULE_NAME}_ALL_EXECS ${_exec_name})
   set (${MODULE_NAME}_ALL_EXECS ${${MODULE_NAME}_ALL_EXECS} PARENT_SCOPE)

 endmacro (module_binary_add)
@@ -1026,6 +1057,17 @@
     message (STATUS "  - Boost required libraries ... : ${BOOST_REQUIRED_LIBS}")
   endif (Boost_FOUND)
 endmacro (display_boost)
+
+# Readline
+macro (display_readline)
+  if (READLINE_FOUND)
+    message (STATUS)
+    message (STATUS "* Readline:")
+    message (STATUS "  - READLINE_VERSION ........... : ${READLINE_VERSION}")
+    message (STATUS "  - READLINE_INCLUDE_DIR ....... : ${READLINE_INCLUDE_DIR}")
+    message (STATUS "  - READLINE_LIBRARY ........... : ${READLINE_LIBRARY}")
+  endif (READLINE_FOUND)
+endmacro (display_readline)

 # MySQL
 macro (display_mysql)
@@ -1136,6 +1178,7 @@
   message (STATUS "---------------------------------")
   #
   display_boost ()
+  display_readline ()
   display_mysql ()
   display_soci ()
   display_stdair ()


bug fix on ctest directory structure config

--- reg_tests/CTestList.cmake
+++ reg_tests/CTestList.cmake
@@ -6,9 +6,9 @@
 function(add_test_r testname )
   add_test(
     ${testname} bash -c "
-      cp ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/*.fst . &&
+      cp ${CMAKE_CURRENT_SOURCE_DIR}/RegressionTestData/test_files/${testname}/*.fst . &&
       ${CMAKE_BINARY_DIR}/glue-codes/fast/openfast ${testname}.fst > ${testname}.log &&
-      python ${CMAKE_CURRENT_SOURCE_DIR}/pass_fail.py ${CMAKE_BINARY_DIR}/reg_tests/${testname}.outb ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.outb ${TOLERANCE}
+      python ${CMAKE_CURRENT_SOURCE_DIR}/pass_fail.py ${CMAKE_BINARY_DIR}/reg_tests/${testname}.outb ${CMAKE_CURRENT_SOURCE_DIR}/RegressionTestData/test_files/${testname}/${testname}.outb ${TOLERANCE}
     "
   )


Follow CMake conventions(?) on script style

Update formatting of CheckCXX11Features script to follow conventions
used in standard CMake modules:

- Two space indents
- No restatment of condition in else(COND)/endif(COND)
- No spaces between if and opening (

These should be reviewed against any official standards.

--- Modules/CheckCXX11Features.cmake
+++ Modules/CheckCXX11Features.cmake
@@ -78,9 +78,9 @@
 # each other (i.e. only one may be present).
 #

-if (NOT CMAKE_CXX_COMPILER_LOADED)
-    message(FATAL_ERROR "CheckCXX11Features modules only works if language CXX is enabled")
-endif ()
+if(NOT CMAKE_CXX_COMPILER_LOADED)
+  message(FATAL_ERROR "CheckCXX11Features modules only works if language CXX is enabled")
+endif()

 cmake_minimum_required(VERSION 2.8.3)

@@ -89,74 +89,83 @@
 #
 include(CheckCXXCompilerFlag)
 check_cxx_compiler_flag("-std=c++11" _HAS_CXX11_FLAG)
-if (NOT _HAS_CXX11_FLAG)
-    check_cxx_compiler_flag("-std=c++0x" _HAS_CXX0X_FLAG)
-endif ()
-
-if (_HAS_CXX11_FLAG)
-    set(CXX11_COMPILER_FLAGS "-std=c++11")
-elseif (_HAS_CXX0X_FLAG)
-    set(CXX11_COMPILER_FLAGS "-std=c++0x")
-endif ()
-
+if(NOT _HAS_CXX11_FLAG)
+  check_cxx_compiler_flag("-std=c++0x" _HAS_CXX0X_FLAG)
+endif()
+
+if(_HAS_CXX11_FLAG)
+  set(CXX11_COMPILER_FLAGS "-std=c++11")
+elseif(_HAS_CXX0X_FLAG)
+  set(CXX11_COMPILER_FLAGS "-std=c++0x")
+endif()
+
+#-----------------------------------------------------------------------
+# function cxx11_check_feature(<name> <result>)
+#
 function(cxx11_check_feature FEATURE_NAME RESULT_VAR)
-    if (NOT DEFINED ${RESULT_VAR})
-      set(_bindir "${CMAKE_CURRENT_BINARY_DIR}/CheckCXX11Features/cxx11_${FEATURE_NAME}")
-
-        set(_SRCFILE_BASE ${CMAKE_CURRENT_LIST_DIR}/CheckCXX11Features/cxx11-test-${FEATURE_NAME})
-        set(_LOG_NAME "\"${FEATURE_NAME}\"")
-        message(STATUS "Checking C++11 support for ${_LOG_NAME}")
-
-        set(_SRCFILE "${_SRCFILE_BASE}.cpp")
-        set(_SRCFILE_FAIL "${_SRCFILE_BASE}_fail.cpp")
-        set(_SRCFILE_FAIL_COMPILE "${_SRCFILE_BASE}_fail_compile.cpp")
-
-        if (CROSS_COMPILING)
-            try_compile(${RESULT_VAR} "${_bindir}" "${_SRCFILE}"
-                        COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
-            if (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL})
-                try_compile(${RESULT_VAR} "${_bindir}_fail" "${_SRCFILE_FAIL}"
-                            COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
-            endif (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL})
-        else (CROSS_COMPILING)
-            try_run(_RUN_RESULT_VAR _COMPILE_RESULT_VAR
-                    "${_bindir}" "${_SRCFILE}"
-                    COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
-            if (_COMPILE_RESULT_VAR AND NOT _RUN_RESULT_VAR)
-                set(${RESULT_VAR} TRUE)
-            else (_COMPILE_RESULT_VAR AND NOT _RUN_RESULT_VAR)
-                set(${RESULT_VAR} FALSE)
-            endif (_COMPILE_RESULT_VAR AND NOT _RUN_RESULT_VAR)
-            if (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL})
-                try_run(_RUN_RESULT_VAR _COMPILE_RESULT_VAR
-                        "${_bindir}_fail" "${_SRCFILE_FAIL}"
-                         COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
-                if (_COMPILE_RESULT_VAR AND _RUN_RESULT_VAR)
-                    set(${RESULT_VAR} TRUE)
-                else (_COMPILE_RESULT_VAR AND _RUN_RESULT_VAR)
-                    set(${RESULT_VAR} FALSE)
-                endif (_COMPILE_RESULT_VAR AND _RUN_RESULT_VAR)
-            endif (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL})
-        endif (CROSS_COMPILING)
-        if (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL_COMPILE})
-            try_compile(_TMP_RESULT "${_bindir}_fail_compile" "${_SRCFILE_FAIL_COMPILE}"
-                        COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
-            if (_TMP_RESULT)
-                set(${RESULT_VAR} FALSE)
-            else (_TMP_RESULT)
-                set(${RESULT_VAR} TRUE)
-            endif (_TMP_RESULT)
-        endif (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL_COMPILE})
-
-        if (${RESULT_VAR})
-            message(STATUS "Checking C++11 support for ${_LOG_NAME}: works")
-        else (${RESULT_VAR})
-            message(STATUS "Checking C++11 support for ${_LOG_NAME}: not supported")
-        endif (${RESULT_VAR})
-        set(${RESULT_VAR} ${${RESULT_VAR}} CACHE INTERNAL "C++11 support for ${_LOG_NAME}")
-    endif (NOT DEFINED ${RESULT_VAR})
-endfunction(cxx11_check_feature)
-
+  if(NOT DEFINED ${RESULT_VAR})
+    set(_bindir "${CMAKE_CURRENT_BINARY_DIR}/CheckCXX11Features/cxx11_${FEATURE_NAME}")
+
+    set(_SRCFILE_BASE ${CMAKE_CURRENT_LIST_DIR}/CheckCXX11Features/cxx11-test-${FEATURE_NAME})
+    set(_LOG_NAME "\"${FEATURE_NAME}\"")
+    message(STATUS "Checking C++11 support for ${_LOG_NAME}")
+
+    set(_SRCFILE "${_SRCFILE_BASE}.cpp")
+    set(_SRCFILE_FAIL "${_SRCFILE_BASE}_fail.cpp")
+    set(_SRCFILE_FAIL_COMPILE "${_SRCFILE_BASE}_fail_compile.cpp")
+
+    if(CROSS_COMPILING)
+      try_compile(${RESULT_VAR} "${_bindir}" "${_SRCFILE}"
+        COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
+      if(${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL})
+        try_compile(${RESULT_VAR} "${_bindir}_fail" "${_SRCFILE_FAIL}"
+          COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
+      endif()
+    else()
+      try_run(_RUN_RESULT_VAR _COMPILE_RESULT_VAR
+        "${_bindir}" "${_SRCFILE}"
+        COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
+      if(_COMPILE_RESULT_VAR AND NOT _RUN_RESULT_VAR)
+        set(${RESULT_VAR} TRUE)
+      else()
+        set(${RESULT_VAR} FALSE)
+      endif()
+
+      if(${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL})
+        try_run(_RUN_RESULT_VAR _COMPILE_RESULT_VAR
+          "${_bindir}_fail" "${_SRCFILE_FAIL}"
+          COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
+        if(_COMPILE_RESULT_VAR AND _RUN_RESULT_VAR)
+          set(${RESULT_VAR} TRUE)
+        else()
+          set(${RESULT_VAR} FALSE)
+        endif()
+      endif()
+    endif()
+
+    if(${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL_COMPILE})
+      try_compile(_TMP_RESULT "${_bindir}_fail_compile" "${_SRCFILE_FAIL_COMPILE}"
+        COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}")
+      if(_TMP_RESULT)
+        set(${RESULT_VAR} FALSE)
+      else()
+        set(${RESULT_VAR} TRUE)
+      endif()
+    endif()
+
+    if(${RESULT_VAR})
+      message(STATUS "Checking C++11 support for ${_LOG_NAME}: works")
+    else()
+      message(STATUS "Checking C++11 support for ${_LOG_NAME}: not supported")
+    endif()
+
+    set(${RESULT_VAR} ${${RESULT_VAR}} CACHE INTERNAL "C++11 support for ${_LOG_NAME}")
+  endif()
+endfunction()
+
+#-----------------------------------------------------------------------
+# Run all checks
+#
 cxx11_check_feature("__func__" HAS_CXX11_FUNC)
 cxx11_check_feature("algorithm_all_of" HAS_CXX11_ALGORITHM_ALL_OF)
 cxx11_check_feature("algorithm_any_of" HAS_CXX11_ALGORITHM_ANY_OF)
@@ -205,3 +214,4 @@
 cxx11_check_feature("type_traits" HAS_CXX11_TYPE_TRAITS)
 cxx11_check_feature("utility_declval" HAS_CXX11_UTILITY_DECLVAL)
 cxx11_check_feature("variadic_templates" HAS_CXX11_VARIADIC_TEMPLATES)
+


BUG: Remove deleted files from elxModuleCore source file list

--- Modules/Core/elxModuleCore.cmake
+++ Modules/Core/elxModuleCore.cmake
@@ -4,10 +4,9 @@
 )

 set( ${MODULE}_SOURCE_FILES
-  ${CMAKE_SOURCE_DIR}/${MODULE_PATH}/Blueprints/src/elxComponentDescriptor.cxx
   ${CMAKE_SOURCE_DIR}/${MODULE_PATH}/Blueprints/src/elxBlueprint.cxx
 )

 set( ${MODULE}_LIBRARIES
-  elxModuleCore
+  ${MODULE}
 )


ignore output of test invocation of rtiddsgen_server

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -259,7 +259,8 @@
   # check that the generator is invocable / finds a Java runtime environment
   execute_process(
     COMMAND "/usr/bin/rtiddsgen_server"
-    RESULT_VARIABLE _retcode)
+    RESULT_VARIABLE _retcode
+    OUTPUT_QUIET ERROR_QUIET)
   if(NOT _retcode EQUAL 0)
     set(Connext_DDSGEN_SERVER)
   endif()


Update device FW

Update device 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 "b263e5292bdb58d776d84a1a7bc1382d116f3488")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "2060e0bdbc2ebd05619321aac693847a83c2f537")

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


Update FW to match depthai-shared

Update FW to match depthai-shared

--- 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 "f1e86083efeaf88f9dc6342e51b88cc3eb41a14b")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "484b9952039f243d7fe57ee2d58d62a797ca784e")

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


Fixed VideoEncoder crash

Fixed VideoEncoder crash

--- 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 "1023338b5a0bee222d45c024cdaeb05fa08248d6")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "1b0bd47c6e66b28f9f66cd7e0e9ecac8ac900eb0")

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


apps:system:rust: Pin the rust toolchain to a specific release

Change-Id: I14c4ccd44dde92b7d2fce2e5b3779e106b761788
GitOrigin-RevId: 3013c9fc96d26d8f0d8e2c13b57f53d08ac03e98

--- apps/system/rust.cmake
+++ apps/system/rust.cmake
@@ -48,7 +48,7 @@
         DEPENDS ${RUST_DEPENDS}
         WORKING_DIRECTORY ${RUST_SOURCE_DIR}
         COMMAND
-            ${CMAKE_COMMAND} -E env cargo +nightly build
+            ${CMAKE_COMMAND} -E env cargo +nightly-2021-08-05 build
             ${CARGO_OPTIONS}
             --target-dir ${RUST_BUILD_DIR}
             --out-dir ${RUST_BUILD_DIR}


ENH: Remove svn version of hdf5 files not added by import from git

Change-Id: I2a9cb324043705a12310f951cc36326ab713ca49

--- Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake/scripts/HDF518config.cmake
+++ Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake/scripts/HDF518config.cmake
@@ -1,261 +0,0 @@
-#############################################################################################
-### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE                                       ###
-### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ###
-### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log      ###
-#############################################################################################
-
-cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
-############################################################################
-# Usage:
-#     ctest -S HDF518config.cmake,OPTION=VALUE -C Release -VV -O test.log
-# where valid options for OPTION are:
-#     BUILD_GENERATOR - The cmake build generator:
-#            Unix    * Unix Makefiles
-#            VS2015    * Visual Studio 14 2015
-#            VS201564 * Visual Studio 14 2015 Win64
-#            VS2013    * Visual Studio 12 2013
-#            VS201364 * Visual Studio 12 2013 Win64
-#            VS2012    * Visual Studio 11 2012
-#            VS201264 * Visual Studio 11 2012 Win64
-#
-#     INSTALLDIR  -  root folder where hdf5 is installed
-#     CTEST_BUILD_CONFIGURATION  - Release, Debug, etc
-#     CTEST_SOURCE_NAME  -  source folder
-#     STATIC_LIBRARIES  -  Build/use static libraries
-#     FORTRAN_LIBRARIES -  Build/use fortran libraries
-#     NO_MAC_FORTRAN  - Yes to be SHARED on a Mac
-##############################################################################
-
-set(CTEST_SOURCE_VERSION 1.8.16)
-set(CTEST_SOURCE_VERSEXT "")
-
-##############################################################################
-# handle input parameters to script.
-#BUILD_GENERATOR - which CMake generator to use, required
-#INSTALLDIR - HDF5-1.8 root folder
-#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo
-#CTEST_SOURCE_NAME - name of source folder; HDF5-1.8.16
-#STATIC_LIBRARIES - Default is YES
-#FORTRAN_LIBRARIES - Default is NO
-#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac
-if(DEFINED CTEST_SCRIPT_ARG)
-    # transform ctest script arguments of the form
-    # script.ctest,var1=value1,var2=value2
-    # to variables with the respective names set to the respective values
-    string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
-    foreach(current_var ${script_args})
-        if ("${current_var}" MATCHES "^([^=]+)=(.+)$")
-            set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
-        endif()
-    endforeach()
-endif()
-
-# build generator must be defined
-if(NOT DEFINED BUILD_GENERATOR)
-  message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264")
-else()
-  if(${BUILD_GENERATOR} STREQUAL "Unix")
-    set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS2015")
-    set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS201564")
-    set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS2013")
-    set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS201364")
-    set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS2012")
-    set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS201264")
-    set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
-  else()
-    message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264")
-  endif()
-endif()
-
-if(NOT DEFINED INSTALLDIR)
-  if(WIN32)
-    set(INSTALLDIR "C:\\Program\ Files\\myhdf5")
-  else()
-    set(INSTALLDIR "/usr/local/myhdf5")
-  endif()
-endif()
-if(NOT DEFINED CTEST_BUILD_CONFIGURATION)
-    set(CTEST_BUILD_CONFIGURATION "Release")
-endif()
-if(NOT DEFINED CTEST_SOURCE_NAME)
-    set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
-endif()
-if(NOT DEFINED STATIC_LIBRARIES)
-    set(STATICLIBRARIES "YES")
-endif()
-if(NOT DEFINED FORTRAN_LIBRARIES)
-    set(FORTRANLIBRARIES "NO")
-endif()
-
-set(CTEST_BINARY_NAME "build")
-set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
-if(WIN32)
-  set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
-  set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
-else()
-  set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
-  set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
-endif()
-
-###################################################################
-#########       Following describes compiler           ############
-if(WIN32)
-  set(SITE_OS_NAME "Windows")
-  set(SITE_OS_VERSION "WIN7")
-  if(${BUILD_GENERATOR} STREQUAL "VS201564")
-    set(SITE_OS_BITS "64")
-    set(SITE_COMPILER_NAME "vs2015")
-    set(SITE_COMPILER_VERSION "14")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS2015")
-    set(SITE_OS_BITS "32")
-    set(SITE_COMPILER_NAME "vs2015")
-    set(SITE_COMPILER_VERSION "14")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS201364")
-    set(SITE_OS_BITS "64")
-    set(SITE_COMPILER_NAME "vs2013")
-    set(SITE_COMPILER_VERSION "12")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS2013")
-    set(SITE_OS_BITS "32")
-    set(SITE_COMPILER_NAME "vs2013")
-    set(SITE_COMPILER_VERSION "12")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS201264")
-    set(SITE_OS_BITS "64")
-    set(SITE_COMPILER_NAME "vs2012")
-    set(SITE_COMPILER_VERSION "11")
-  elseif(${BUILD_GENERATOR} STREQUAL "VS2012")
-    set(SITE_OS_BITS "32")
-    set(SITE_COMPILER_NAME "vs2012")
-    set(SITE_COMPILER_VERSION "11")
-  endif()
-##  Set the following to unique id your computer  ##
-  set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX")
-else()
-##  Set the following to unique id your computer  ##
-  if(APPLE)
-    set(CTEST_SITE "MAC.XXXX")
-  else()
-    set(CTEST_SITE "LINUX.XXXX")
-  endif()
-endif()
-###################################################################
-
-###################################################################
-#########       Following is for submission to CDash   ############
-###################################################################
-set(MODEL "Experimental")
-###################################################################
-
-###################################################################
-#####       Following controls CDash submission               #####
-#set(LOCAL_SUBMIT "TRUE")
-#####       Following controls test process                   #####
-#set(LOCAL_SKIP_TEST "TRUE")
-#set(LOCAL_MEMCHECK_TEST "TRUE")
-#set(LOCAL_COVERAGE_TEST "TRUE")
-#####       Following controls cpack command                  #####
-#set(LOCAL_NO_PACKAGE "TRUE")
-#####       Following controls source update                  #####
-#set(LOCAL_UPDATE "TRUE")
-set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8_16")
-#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
-#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
-###################################################################
-
-###################################################################
-####  Change default configuration of options in config/cmake/cacheinit.cmake file ###
-####  format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ")
-
-###################################################################
-if(${STATICLIBRARIES})
-  set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
-  #########       Following describes computer           ############
-  ## following is optional to describe build                       ##
-  set(SITE_BUILDNAME_SUFFIX "STATIC")
-endif()
-###################################################################
-
-### uncomment/comment and change the following lines for other configuration options
-
-####      ext libraries       ####
-### ext libs from tgz
-set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}")
-### ext libs from svn
-#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN")
-### ext libs on system
-#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include")
-#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include")
-### disable ext libs building
-#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF")
-#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF")
-#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
-####      fortran       ####
-if(${FORTRANLIBRARIES})
-  set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
-  ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
-  set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
-else()
-  set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
-  ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
-  set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
-endif()
-
-### disable test program builds
-#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF")
-
-### disable packaging
-#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON")
-### Create install package with external libraries (szip, zlib, jpeg)
-set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
-
-### change install prefix
-set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}")
-
-###################################################################
-
-if(WIN32)
-  include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
-  if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe")
-    file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
-  endif()
-  if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi")
-    file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION  ${CTEST_SCRIPT_DIRECTORY})
-  endif()
-  if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip")
-    file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION  ${CTEST_SCRIPT_DIRECTORY})
-  endif()
-else()
-  include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
-  if(APPLE)
-    if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg")
-      file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
-    endif()
-    if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz")
-      file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION  ${CTEST_SCRIPT_DIRECTORY})
-    endif()
-    if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh")
-      file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
-    endif()
-  else()
-    if(CYGWIN)
-      if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh")
-        file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
-      endif()
-      if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz")
-        file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION  ${CTEST_SCRIPT_DIRECTORY})
-      endif()
-    else()
-      if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh")
-        file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
-      endif()
-      if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz")
-        file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION  ${CTEST_SCRIPT_DIRECTORY})
-      endif()
-    endif()
-  endif()
-endif()


BUG: Modify External FADTTS

BUG: Modify External FADTTS

--- SuperBuild/External_FADTTS.cmake
+++ SuperBuild/External_FADTTS.cmake
@@ -63,7 +63,7 @@
     )

   ### --- End Project specific additions
-  set( ${proj}_REPOSITORY ${git_protocol}://github.com/NIRALUser/FADTTS.git)
+  set( ${proj}_REPOSITORY ${git_protocol}://github.com/NIRALUser/FADTTSter.git)
   set( ${proj}_GIT_TAG release )
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
@@ -86,7 +86,7 @@
     DEPENDS
       ${${proj}_DEPENDENCIES}
   )
-  set(${extProjName}_DIR ${EXTERNAL_BINARY_DIRECTORY}/${proj}-install/lib/CMake/${proj})
+  set(${extProjName}_DIR ${EXTERNAL_BINARY_DIRECTORY}/${proj}-install/lib/cmake/${proj})
 else()
   if(${USE_SYSTEM_${extProjName}})
     find_package(${extProjName} ${${extProjName}_REQUIRED_VERSION} REQUIRED)


Handle files without extensions.

Handle files without extensions.

If cmake_unit_create_source_file_before_build or
cmake_unit_generate_source_file_during_build was called passing
the name of a file with no extension, it would crash. This was
incorrect behaviour.

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -286,9 +286,15 @@
     endif ()

     # Detect intended file type from filename
-
     get_filename_component (EXTENSION "${GET_CREATED_NAME}" EXT)
-    string (SUBSTRING "${EXTENSION}" 1 -1 EXTENSION)
+
+    # Remove leading dot
+    if (EXTENSION)
+
+        string (SUBSTRING "${EXTENSION}" 1 -1 EXTENSION)
+
+    endif ()
+
     set (SOURCE_EXTENSIONS
          ${CMAKE_C_SOURCE_FILE_EXTENSIONS}
          ${CMAKE_CXX_SOURCE_FILE_EXTENSIONS})


Fixed LuaJIT native build on Raspberry Pi.

Missed out one more condition check before applying -m32/64 flag.

--- Source/ThirdParty/LuaJIT/DetectTargetArchitecture.cmake
+++ Source/ThirdParty/LuaJIT/DetectTargetArchitecture.cmake
@@ -93,7 +93,9 @@
         set (ARCH_BITS 32)
     endif ()
 endif ()
-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m${ARCH_BITS}")
+if (TARGET_LJARCH STREQUAL x64)
+    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m${ARCH_BITS}")
+endif ()

 find_string ("LJ_HASJIT (1)" "${TARGET_TESTARCH}" HASJIT ${VARIANT})
 if (HASJIT)


Added support for juggling Debug/Release in MSVC.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -1,3 +1,5 @@
+set(DOLLAR_SIGN "$")
+
 if (${IOS})
   add_definitions(-DIOS=1)
   set(BUILD_SHARED_LIBS OFF)
@@ -6,16 +8,16 @@
 endif ()

 macro(create_library target)
-  set (CMAKE_OSX_ARCHITECTURES "armv7 arm64")
+  set(CMAKE_OSX_ARCHITECTURES "armv7 arm64")

   # Optimize debug build to help diagnose release build crashes.
-    if (GCC_DEBUG_OPTIMIZATION_LEVEL)
-      set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -${GCC_DEBUG_OPTIMIZATION_LEVEL}")
-    endif()
+  if (GCC_DEBUG_OPTIMIZATION_LEVEL)
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -${GCC_DEBUG_OPTIMIZATION_LEVEL}")
+  endif ()

   if (MSVC_DEBUG_FLAGS)
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_DEBUG_FLAGS}")
-  endif()
+  endif ()

   set(CURRENT_TARGET ${target})
   #message(WARNING "*${PROJECT_NAME} STREQUAL ${target}*")
@@ -341,18 +343,26 @@
     set(libname ${path})
   endif ()

-  set(fullpath ${MYTHIC_DEPENDENCIES}/${path}/lib)
-
-  doctor_static(libname ${fullpath} ${is_dynamic})
-
-#  message("${CURRENT_TARGET} ${fullpath}/${libname}")
-  if (IOS)
-    target_link_libraries(${CURRENT_TARGET} "-l${fullpath}/${libname}")
-  else ()
-    target_link_libraries(${CURRENT_TARGET} "${fullpath}/${libname}")
-  endif ()
-
-  include_directories(${MYTHIC_DEPENDENCIES}/${path}/include)
+  if (MSVC)
+    foreach (build_mode Release Debug)
+      set(fullpath ${MYTHIC_DEPENDENCIES}/${build_mode}/${path}//lib)
+      doctor_static(libname ${fullpath} ${is_dynamic})
+      target_link_libraries(${CURRENT_TARGET} "${fullpath}/${libname}")
+      include_directories(${MYTHIC_DEPENDENCIES}/${build_mode}/${path}/include)
+    endforeach ()
+  else ()
+    set(fullpath ${MYTHIC_DEPENDENCIES}/${path}//lib)
+    doctor_static(libname ${fullpath} ${is_dynamic})
+
+    #  message("${CURRENT_TARGET} ${fullpath}/${libname}")
+    if (IOS)
+      target_link_libraries(${CURRENT_TARGET} "-l${fullpath}/${libname}")
+    else ()
+      target_link_libraries(${CURRENT_TARGET} "${fullpath}/${libname}")
+    endif ()
+
+    include_directories(${MYTHIC_DEPENDENCIES}/${path}/include)
+  endif ()

 endmacro()


adding Guichan to the list of supported library

--- dist/WkUtils.cmake
+++ dist/WkUtils.cmake
@@ -81,6 +81,9 @@
 	if ( ${${varname}} STREQUAL "OpenGL" )
 		set ( ${varname} "OPENGL")
 	endif ( ${${varname}} STREQUAL "OpenGL" )
+	if ( ${${varname}} STREQUAL "Guichan" )
+		set ( ${varname} "GUICHAN")
+	endif ( ${${varname}} STREQUAL "Guichan" )
 	#etc.
 	# add whats needed for the projects we support, waiting for a standard way in cmake modules...


#1273 - OpenIGTLink version update due to bugfixes.

git-svn-id: f70d4c833b20674991d6651a5f592bbdbe6b47b2@8321 30ced1d1-d8fb-0310-b896-84269ee58dd6

--- CMake/CMakeExternals/OPENIGTLINK.cmake
+++ CMake/CMakeExternals/OPENIGTLINK.cmake
@@ -33,8 +33,8 @@
 SET(OPENIGTLINK_DEPENDS ${proj})

 IF(NOT DEFINED OpenIGTLink_DIR)
-
-    SET(revision_tag 85f359f008)
+#1273 - OpenIGTLink version update due to bugfixes.
+    SET(revision_tag 6cf82567a9)
     IF(${proj}_REVISION_TAG)
         SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


Update 'toluapp' example

Update 'toluapp' example

--- examples/toluapp/config.cmake
+++ examples/toluapp/config.cmake
@@ -1,4 +1,4 @@
 # DOCUMENTATION_START {
 # config.cmake
-hunter_config(Lua VERSION 5.1.5-p1)
+hunter_config(Lua VERSION 5.1.5-p2)
 # DOCUMENTATION_END }


Fix Mac Json cmake script

Fix Mac Json cmake script

--- indra/cmake/JsonCpp.cmake
+++ indra/cmake/JsonCpp.cmake
@@ -14,7 +14,7 @@
       debug json_vc100debug_libmt.lib
       optimized json_vc100_libmt)
   elseif (DARWIN)
-    set(JSONCPP_LIBRARIES libjson_linux-gcc-4.0.1_libmt.a)
+    set(JSONCPP_LIBRARIES libjson_darwin_libmt.a)
   elseif (LINUX)
     set(JSONCPP_LIBRARIES libjsoncpp.a)
   endif (WINDOWS)


Attempt to workaround all the limitations for Urho3D DLL installation.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -973,7 +973,9 @@
         if (TARGET Urho3D)
             add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Urho3D> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
         else ()
-            # TODO: Handle the case for external project
+            foreach (URHO3D_DLL ${URHO3D_LIBRARIES})
+                add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${URHO3D_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+            endforeach ()
         endif ()
     endif ()
     # Need to check if the destination variable is defined first because this macro could be called by external project that does not wish to install anything
@@ -996,14 +998,22 @@
             if (WIN32 AND NOT ARG_NODEPS AND URHO3D_LIB_TYPE STREQUAL SHARED AND NOT URHO3D_DLL_INSTALLED AND NOT DEST_RUNTIME_DIR STREQUAL bin)
                 if (TARGET Urho3D)
                     if (CMAKE_VERSION VERSION_LESS 3.0)
-                        # What to do? Upgrade the minimum CMake version? Or workaround it again?
+                        get_target_property (LOCATION Urho3D LOCATION)
+                        get_filename_component (LOCATION ${LOCATION} PATH)
+                        if (CMAKE_GENERATOR MATCHES 2008)
+                            string (REPLACE /$(OutDir) "" LOCATION ${LOCATION})
+                        elseif (MSVC)
+                            string (REPLACE /$(Configuration) "" LOCATION ${LOCATION})
+                        endif ()
+                        file (GLOB URHO3D_DLL ${LOCATION}/Urho3D*.dll)
+                        install (FILES ${URHO3D_DLL} DESTINATION ${DEST_RUNTIME_DIR})
                     else ()
                         install (FILES $<TARGET_FILE:Urho3D> DESTINATION ${DEST_RUNTIME_DIR})
-                        set (URHO3D_DLL_INSTALLED TRUE)
                     endif ()
                 else ()
-                    # TODO: Handle the case for external project
+                    install (FILES ${URHO3D_LIBRARIES} DESTINATION ${DEST_RUNTIME_DIR})
                 endif ()
+                set (URHO3D_DLL_INSTALLED TRUE)
             endif ()
             if (DIRECT3D_DLL AND NOT DIRECT3D_DLL_INSTALLED)
                 # Make a copy of the D3D DLL to the runtime directory in the installed location


Remove "References" and "Referenced by" links from doc

They auto generated links are quite long on some functions, making
the documentation harder to read.

--- doc/Doxyfile.cmake
+++ doc/Doxyfile.cmake
@@ -103,8 +103,8 @@
 SOURCE_BROWSER = NO
 INLINE_SOURCES = NO
 STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
 REFERENCES_LINK_SOURCE = YES
 USE_HTAGS = NO
 VERBATIM_HEADERS = NO


Special autoformatting macros for c and c++ files

git-svn-id: ff420cdfd4b96e96fca1ec56388a20c3b5ac679c@614 9e4c620c-c391-4b63-a7fb-4924991ea895

--- build/autoformat.cmake
+++ build/autoformat.cmake
@@ -77,7 +77,7 @@
         WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
     )
   endif()
-  if( MZ_CPPLINT_BIN AND MZ_DO_CPPLINT )
+  if( MZ_CPPLINT_BIN AND MZ_DO_CPPLINT AND NOT __MZ_NO_CPPLINT )
     add_library(${_new_target_lint} STATIC ${CMAKE_CURRENT_BINARY_DIR}/lint_step.c)
     set_target_properties(${_new_target_lint} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
     add_custom_command(
@@ -92,7 +92,12 @@
   mz_debug_message("NEW_TARGET=${_new_target_format};${_new_target_lint}, WORKING_DIRECTORY=${CMAKE_CURRENT_LIST_DIR}")
 endmacro()

-macro(mz_auto_header _TARGET _HEADER)
-   set(__MZ_AUTOFORMAT_ADD_CONFIG "cmt_insert_file_header=${_HEADER}")
+macro(mz_auto_format_c _TARGET)
+   set(__MZ_NO_CPPLINT TRUE)
    mz_auto_format(${_TARGET} ${ARGN})
 endmacro()
+
+macro(mz_auto_format_cxx _TARGET)
+   set(__MZ_NO_CPPLINT TRUE)
+   mz_auto_format(${_TARGET} ${ARGN})
+endmacro()


git-svn-id: svn://scm.gforge.inria.fr/svn/openvibe@503 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- openvibe-modules/xml/trunc/src/FindExpat.cmake
+++ openvibe-modules/xml/trunc/src/FindExpat.cmake
@@ -16,11 +16,11 @@

 IF(WIN32)
 	FIND_PATH(EXPAT_expat_INCLUDE_PATH "expat.h"
-		"C:/Expat-2.0.0/Source/lib"
+		PATHS "$ENV{OV_DEP_EXPAT}/Source/lib"
 	)
 	FIND_LIBRARY(EXPAT_expat_LIBRARY
 		NAMES libexpat
-		PATHS "C:/Expat-2.0.0/Libs"
+		PATHS "$ENV{OV_DEP_EXPAT}/Libs" "$ENV{OV_DEP_EXPAT}/Bin"
 	)

 	IF(EXPAT_expat_INCLUDE_PATH)


Find sphinx-apidoc as well

Find sphinx-apidoc as well

This one will gather all docstrings from inside Python for us.

--- cmake/FindSphinx.cmake
+++ cmake/FindSphinx.cmake
@@ -2,4 +2,8 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Sphinx DEFAULT_MSG SPHINX_EXECUTABLE)

-mark_as_advanced(SPHINX_EXECUTABLE)+find_program(SPHINX_APIDOC_EXECUTABLE NAMES sphinx-apidoc HINTS $ENV{SPHINX_DIR} PATH_SUFFIXES bin DOC "Sphinx generator for reStructuredText API files of Python source code.")
+find_package_handle_standard_args(Sphinx-apidoc DEFAULT_MSG SPHINX_APIDOC_EXECUTABLE)
+
+mark_as_advanced(SPHINX_EXECUTABLE)
+mark_as_advanced(SPHINX_APIDOC_EXECUTABLE)


No need to look for zmq.hpp anymore

No need to look for zmq.hpp anymore

--- cmake/FindZeroMQ.cmake
+++ cmake/FindZeroMQ.cmake
@@ -36,22 +36,27 @@
 set(ZEROMQ_FOUND FALSE)

 if(ZEROMQ)
-  # Custom ZeroMQ installation specified.
-  find_library(ZEROMQ_LIBRARIES NAMES zmq
-                                PATHS ${ZEROMQ}/lib ${ZEROMQ}/lib/x86_64-linux-gnu
-                                NO_DEFAULT_PATH
-                                DOC "Path to libzmq.")
-  find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.h zmq_utils.h zmq.hpp
-                               PATHS ${ZEROMQ}/include
-                               NO_DEFAULT_PATH
-                               DOC "Path to ZeroMQ include header files.")
-else()
-  # No custom ZeroMQ specified. Searching for ZeroMQ system-wide.
-  find_library(ZEROMQ_LIBRARIES NAMES zmq
-                                DOC "Path to libzmq.")
-  find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.h zmq_utils.h
-                               DOC "Path to ZeroMQ include header files.")
-endif()
+    # ZeroMQ is installed in a custom place
+    find_library(ZEROMQ_LIBRARIES NAMES zmq
+                PATHS ${ZEROMQ}/lib
+                NO_DEFAULT_PATH
+                DOC "Path to libzmq)"
+            )
+    find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.h zmq_utils.h
+                PATHS ${ZEROMQ}/include
+                NO_DEFAULT_PATH
+                DOC "Path to ZeroMQ include header files."
+            )
+else(ZEROMQ)
+        # Check is the library is installed on the system
+    find_library(ZEROMQ_LIBRARIES NAMES zmq
+                DOC "Path to libzmq)"
+            )
+
+    find_path(ZEROMQ_INCLUDE_DIR NAMES zmq_utils.h
+                DOC "Path to ZeroMQ include header files."
+            )
+endif(ZEROMQ)

 mark_as_advanced(ZEROMQ_LIBRARIES ZEROMQ_INCLUDE_DIR)


Add new environment variable: BC_UNIT_TEST_VG

When set, unit tests will be run through valgrind

--- cmake/TestHelper.cmake
+++ cmake/TestHelper.cmake
@@ -1,6 +1,11 @@
 macro(def_test testName)
     add_executable(Test${testName} Test${testName}.cpp ${COMMON_SOURCES})
     target_link_libraries(Test${testName} ${TEST_LIBS} ${GTEST_BOTH_LIBRARIES})
-    add_test(Test${testName} Test${testName})
+    if($ENV{BC_UNIT_TEST_VG})
+        add_test(NAME Test${testName} COMMAND valgrind --error-exitcode=1 $<TARGET_FILE:Test${testName}>)
+    else()
+        add_test(NAME Test${testName} COMMAND Test${testName})
+    endif()
+
     set_tests_properties(Test${testName} PROPERTIES LABELS unit)
 endmacro(def_test testName)


Update CMake module documentation

Update CMake module documentation

--- cmake/Versioning.cmake
+++ cmake/Versioning.cmake
@@ -1,43 +1,59 @@
 # Versioning.cmake
 #
-# set_version()
-#   Set version string variable to value X.Y.Z defined in the file VERSION or
-#   Git branch and commit if that file does not exist. If no VERSION file or Git
-#   information are present, the version is set to "dev".
-#
-# create_version_header(create_version_header output_version_file)
-#   Replace version string in template file and create output header file. If
-#   you want to generate a new header file with an updated version string, you
-#   must run CMake again.
+# Automated version string and variable definition and substitution based on the
+# ECDC versioning scheme.
+#
+# The version string is set according to the algorithm below:
+#
+#   if VERSION file with string X.Y.Z is present:
+#     VERSION_STRING = "X.Y.Z"
+#   else if Git is present and directory is a Git repository:
+#     VERSION_STRING = "<branch>-<commit>[-dirty]"
+#   else:
+#     VERSION_STRING = "dev"
+#
+# The version variables are set to the components "X", "Y" and "Z" if the
+# version string is "X.Y.Z". If the version string does not have that form, all
+# version variables are set to "0".
+#
+# Functions and macros exported by this module:
+#
+#   set_version() [function]
+#     Set version string variable according to the algorithm described above.
+#
+#   create_version_header(version_template_file output_version_file) [macro]
+#     Replace version string in template file, creating output file. To generate
+#     a new header file with an updated version string, CMake must be run again.
 #
 # Variables set by this module:
 #
-#   - VERSION_STRING: the version string defined according to the rules above.
-#   - MAJOR_VERSION: the major component of the version (X) or 0 if not defined.
-#   - MINOR_VERSION: the minor component of the version (Y) or 0 if not defined.
-#   - PATCH_VERSION: the patch component of the version (Z) or 0 if not defined.
+#   VERSION_STRING: the version string defined according to the algorithm above.
+#   MAJOR_VERSION: the major component of the version (X) or 0 if not defined.
+#   MINOR_VERSION: the minor component of the version (Y) or 0 if not defined.
+#   PATCH_VERSION: the patch component of the version (Z) or 0 if not defined.
 #
 # External requirements:
 #
-#   - Git (if the file VERSION does not exist)
-#
-# Examples:
-#
-#   If the content of VERSION is "1.2.3", VERSION_STRING will be set to "1.2.3".
-#   If that file does not exist and the current Git branch is "master" on commit
-#   "bc5b2c50e1fc8b1ce96607aa2f0d373900634389", with no non-committed changes to
-#   tracked files, VERSION_STRING will be set to "master-bc5b2c5".
+#   Git (if the file VERSION does not exist).
+#
+# Example usage:
+#
+#   # If the content of VERSION is "1.2.3", VERSION_STRING will be set to
+#   # "1.2.3". If that file does not exist and the current Git branch is
+#   # master on commit bc5b2c50e1fc8b1ce96607aa2f0d373900634389, with no
+#   # non-committed changes to tracked files, VERSION_STRING will be set to
+#   # "master-bc5b2c5".
 #
 #   # Call set_version in the main CMakeLists.txt file to define VERSION_STRING:
 #   set_version()
 #
-#   # Generate header file substituting "@VERSION_STRING@" with the value of the
-#   # variable in Version.h.in; the output file will be created in the current
-#   # build directory and will be named Version.h:
-#   create_version_header(Version.h.in)
-#
-
-# Set the DIRECTORY_IS_GIT_REPO variable
+#   # Generate header file ${CMAKE_BINARY_DIR}/version/Version.h substituting
+#   # "@VERSION_STRING@" with the value of the variable in Version.h.in:
+#   create_version_header(Version.h.in ${CMAKE_BINARY_DIR}/version/Version.h)
+#
+
+# Set the DIRECTORY_IS_GIT_REPO variable if current directory is a Git
+# repository.
 function(is_directory_git_repo)
   execute_process(
     COMMAND           "${GIT_EXECUTABLE}" status
@@ -123,7 +139,8 @@
   endif()
 endfunction()

-# Set VERSION_STRING if the argument has the form "X.Y.Z".
+# Set VERSION_STRING if the argument has the form "X.Y.Z" and version variables
+# to the value of the components.
 macro(match_and_set_version_variables version)
   if("${version}" MATCHES "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)$")
     set(VERSION_STRING ${version} PARENT_SCOPE)
@@ -135,7 +152,8 @@
   endif()
 endmacro()

-# Set VERSION_STRING to "<branch>-<commit>[-dirty]".
+# Set VERSION_STRING to "<branch>-<commit>[-dirty]" and all version variables
+# to "0".
 macro(set_version_variables_from_git_branch_and_commit)
   set_git_branch_variable()
   set_git_short_ref_variable()


Add version component vars to CMake setup

--- cmake/Versioning.cmake
+++ cmake/Versioning.cmake
@@ -14,11 +14,15 @@
 #       is be used as the version string. Otherwise, the Git branch and commit
 #       are used to create the version string "<branch>-<commit>[-dirty]", where
 #       "-dirty" is appended if there are non-committed chages in the Git
-#       repository.
+#       repository. When the git branch and commit are used, the version
+#       component variables are all set to "0".
 #
 # Variables set by this module:
 #
 #   - VERSION_STRING: the version string defined according to the rules above.
+#   - MAJOR_VERSION: the major component of the version (X)
+#   - MINOR_VERSION: the minor component of the version (Y)
+#   - PATCH_VERSION: the patch component of the version (Z)
 #
 # External requirements:
 #
@@ -112,6 +116,9 @@
 macro(match_and_set_version_variables version)
   if("${version}" MATCHES "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)([-]rc[1-9][0-9]*)?$")
     set(VERSION_STRING ${version} PARENT_SCOPE)
+    set(MAJOR_VERSION "${CMAKE_MATCH_1}" PARENT_SCOPE)
+    set(MINOR_VERSION "${CMAKE_MATCH_2}" PARENT_SCOPE)
+    set(PATCH_VERSION "${CMAKE_MATCH_3}" PARENT_SCOPE)
   else()
     message(FATAL_ERROR "Version ${version} does not match format X.Y.Z[-rcW]")
   endif()
@@ -124,6 +131,9 @@
   set_git_short_ref_variable()
   set_git_dirty_variable()
   set(VERSION_STRING "${GIT_BRANCH}-${GIT_SHORT_REF}${GIT_DIRTY}" PARENT_SCOPE)
+  set(MAJOR_VERSION "0" PARENT_SCOPE)
+  set(MINOR_VERSION "0" PARENT_SCOPE)
+  set(PATCH_VERSION "0" PARENT_SCOPE)
 endmacro()

 # Set version string variable to release version or Git branch and commit.


md5 for libogg

md5 for libogg

--- cmake/get-libogg.cmake
+++ cmake/get-libogg.cmake
@@ -22,7 +22,7 @@
     DOWNLOAD_DIR    ${DEPENDENCY_DOWNLOAD_DIR}
     DOWNLOAD_NAME   libogg-v${LIBOGG_VERSION}.zip
     URL             http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.zip
-    URL_MD5         1
+    URL_MD5         621b890fb8ce1383327df1d5bd000817
     PATCH_COMMAND   ${CMAKE_COMMAND} -E copy ${CMAKE_MODULE_PATH}/patches/libogg/CMakeLists.txt  ${DEPENDENCY_EXTRACT_DIR}/src/libogg
     CMAKE_ARGS      ${LIBOGG_CMAKE_ARGS}
 )


Internal change

Internal change

PiperOrigin-RevId: 303944364
Change-Id: I2b1c05111b7d4a671ab548ee24418941be6ed002

--- cmake/googletest.cmake
+++ cmake/googletest.cmake
@@ -14,8 +14,7 @@

 ExternalProject_Add(googletest
   GIT_REPOSITORY https://github.com/google/googletest.git
-  # Snapshot from 2019-05-20
-  GIT_TAG f71fb4f9a912ec945401cc49a287a759b6131026
+  GIT_TAG e588eb1ff9ff6598666279b737b27f983156ad85 # 2020-02-27
   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest
   # Just use CMake to clone into directory
   CONFIGURE_COMMAND ""


X11: link GL lib if Qt version less than 5.3.0

--- src/X11/projectDef.cmake
+++ src/X11/projectDef.cmake
@@ -32,3 +32,7 @@
     ${PLUGIN_INTERNAL_DEPS}
     vlc
     )
+
+if( Qt5Core_VERSION VERSION_LESS "5.3.0" )
+    target_link_libraries( ${PROJECT_NAME} GL )
+endif()


Graph Control 4.0.2-1 Gold

Graph Control 4.0.2-1 Gold

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,8 +5,8 @@
 set ( HPCC_MAJOR 4 )
 set ( HPCC_MINOR 0 )
 set ( HPCC_POINT 2 )
-set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 3 )
+set ( HPCC_MATURITY "release" )
+set ( HPCC_SEQUENCE 1 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Split off 7.6.22

Split off 7.6.22

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 6 )
-set ( HPCC_POINT 21 )
+set ( HPCC_POINT 23 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Build: option to time individual compile commands (#3194)

This adds a new cmake variable in our build system, TIME_COMMANDS,
that when set ON will adjust the compile and link rule launch to
include a time command. This is probably only useful when also setting
`CMAKE_BUILD_PARALLEL_LEVEL=1` so that build are happening serially.
The use case is to investigate how long each module takes to compile,
for optimizing the build.

--- src/cmake/compiler.cmake
+++ src/cmake/compiler.cmake
@@ -189,6 +189,10 @@
 endif ()

+# We will use this for ccache and timing
+set (MY_RULE_LAUNCH "")
+
+
 ###########################################################################
 # Use ccache if found
 #
@@ -202,9 +206,27 @@
     if (CMAKE_COMPILER_IS_CLANG AND USE_QT AND (NOT DEFINED ENV{CCACHE_CPP2}))
         message (STATUS "Ignoring ccache because clang + Qt + env CCACHE_CPP2 is not set")
     else ()
-        set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
-        set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
-    endif ()
+        set (MY_RULE_LAUNCH ccache)
+    endif ()
+endif ()
+
+
+###########################################################################
+# Build time debugging aid: time all compile & link commands
+#
+# Note, though, that this is not especially helpful when doing a parallel
+# build. If you wish to time individual compile commands, it's best to also
+# set `-j 1` or CMAKE_BUILD_PARALLEL_LEVEL to 1.
+option (TIME_COMMANDS "Time each compile and link command" OFF)
+if (TIME_COMMANDS)
+    set (MY_RULE_LAUNCH "${CMAKE_COMMAND} -E time ${MY_RULE_LAUNCH}")
+endif ()
+
+
+# Note: This must be after any option that alters MY_RULE_LAUNCH
+if (MY_RULE_LAUNCH)
+    set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${MY_RULE_LAUNCH})
+    set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ${MY_RULE_LAUNCH})
 endif ()


COMP: Add -D_LARGEFILE64_SOURCE for HDF5 with Emscripten-1.

This addresses the build error:

/usr/src/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FDstdio.c:195:5: error: use of undeclared identifier 'off64_t'
    MAXADDR,                                    /*maxaddr               */
    ^

with Emscripten 1.34.3 where CMAKE_SYSTEM is Emscripten-1
because _LARGEFILE64_SOURCE needs to be defined for off64_t to be defined.

Change-Id: Ia84794ff6a240c3f977c2d028eb2ffb18032aeb2

--- Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake/ConfigureChecks.cmake
+++ Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake/ConfigureChecks.cmake
@@ -292,7 +292,7 @@
 SET (LINUX_LFS 0)

 SET (HDF5_EXTRA_FLAGS)
-IF (CMAKE_SYSTEM MATCHES "Linux")
+IF (CMAKE_SYSTEM MATCHES "Linux" OR CMAKE_SYSTEM MATCHES "Emscripten")
   # Linux Specific flags
   SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE -D_BSD_SOURCE)
   OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
@@ -301,7 +301,7 @@
     SET (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
   ENDIF (HDF5_ENABLE_LARGE_FILE)
   SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS})
-ENDIF (CMAKE_SYSTEM MATCHES "Linux")
+ENDIF (CMAKE_SYSTEM MATCHES "Linux" OR CMAKE_SYSTEM MATCHES "Emscripten")

 ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS})


missing include for libiberty (Ubuntu 14.04)

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -303,6 +303,7 @@
 IF(HASBFD)
 	ADD_DEFINITIONS("-DHASBFD")
 	SET(LIBS ${LIBS} bfd opcodes iberty)
+	INCLUDE_DIRECTORIES(/usr/include/libiberty)
 ENDIF(HASBFD)


fix include path on osx

fix include path on osx

--- Shared/CMake/JamomaUtilFunctions.cmake
+++ Shared/CMake/JamomaUtilFunctions.cmake
@@ -26,8 +26,11 @@
 			ARCHIVE DESTINATION lib
 			RUNTIME DESTINATION bin
 			INCLUDES DESTINATION include)
-	install(FILES ${PROJECT_HDRS} DESTINATION "include/jamoma" COMPONENT Devel)
-
+	if(APPLE)
+		INSTALL(FILES ${PROJECT_HDRS} DESTINATION "include")
+	else()
+		install(FILES ${PROJECT_HDRS} DESTINATION "include/jamoma" COMPONENT Devel)
+	endif()
 	export(EXPORT ${PROJECT_NAME}Targets
 		   FILE "${CMAKE_CURRENT_BINARY_DIR}/Jamoma/JamomaTargets.cmake"
 		   NAMESPACE Jamoma::)


COMP: Ensure headers like "stdlib.h" can be found on macOS when building LAPACK

This commit fixes errors like the following:

  [...]
  /Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc  \
    -I/path/to/SPHARM-PDM-build/LAPACK/LAPACKE/include \
    -I/path/to/SPHARM-PDM-build/LAPACK-build/include -O3 -DNDEBUG \
    -fPIC -MD -MT LAPACKE/CMakeFiles/lapacke.dir/src/lapacke_cbbcsd.c.o -MF \
    CMakeFiles/lapacke.dir/src/lapacke_cbbcsd.c.o.d -o CMakeFiles/lapacke.dir/src/lapacke_cbbcsd.c.o \
    -c /path/to/SPHARM-PDM-build/LAPACK/LAPACKE/src/lapacke_cbbcsd.c

  In file included from /path/to/SPHARM-PDM-build/LAPACK/LAPACKE/src/lapacke_cbbcsd.c:34:
  In file included from /path/to/SPHARM-PDM-build/LAPACK/LAPACKE/include/lapacke_utils.h:37:
  /path/to/SPHARM-PDM-build/LAPACK/LAPACKE/include/lapacke.h:44:10: fatal error: 'stdlib.h' file not found

Specifying the `CMAKE_OSX_SYSROOT` option ensures the `-isysroot` parameter is
is passed to successfully look up the headers:

  /Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc  \
    -I/path/to/SPHARM-PDM-build/LAPACK/LAPACKE/include \
    -I/path/to/SPHARM-PDM-build/LAPACK-build/include -O3 -DNDEBUG \
    -isysroot /Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk \
    -fPIC -MD -MT LAPACKE/CMakeFiles/lapacke.dir/src/lapacke_cbbcsd.c.o -MF \
    CMakeFiles/lapacke.dir/src/lapacke_cbbcsd.c.o.d -o CMakeFiles/lapacke.dir/src/lapacke_cbbcsd.c.o \
    -c /path/to/SPHARM-PDM-build/LAPACK/LAPACKE/src/lapacke_cbbcsd.c

References:
* https://andreasfertig.blog/2021/02/clang-and-gcc-on-macos-catalina-finding-the-include-paths/


CMake: make LLVM_OPTIMIZED_TABLEGEN friendly with LLVM_EXTERNAL_CLANG_SOURCE_DIR

This is need because of clang-tblgen

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

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

--- cmake/modules/CrossCompile.cmake
+++ cmake/modules/CrossCompile.cmake
@@ -41,10 +41,15 @@
     if (buildtype)
       set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
     endif()
+	if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
+	  # Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
+	  set(external_clang_dir "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
+	endif()
     execute_process(COMMAND ${CMAKE_COMMAND} ${build_type_flags}
         -G "${CMAKE_GENERATOR}" -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}
         ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
         -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
+        ${external_clang_dir}
       WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} )
   endif(NOT IS_DIRECTORY ${LLVM_${target_name}_BUILD})


bump version to 0.3.0

bump version to 0.3.0

--- src/CPackConfig.cmake
+++ src/CPackConfig.cmake
@@ -3,7 +3,7 @@
 set(CPACK_PACKAGE_NAME "libtmx0")

 set(CPACK_PACKAGE_VERSION_MAJOR "0")
-set(CPACK_PACKAGE_VERSION_MINOR "2")
+set(CPACK_PACKAGE_VERSION_MINOR "3")
 set(CPACK_PACKAGE_VERSION_PATCH "0")
 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")


Disable CDash test submission

Disable CDash test submission

CDash is not currently used, and the public drop site allows anyone to submit results.

--- src/CTestConfig.cmake
+++ src/CTestConfig.cmake
@@ -6,10 +6,10 @@
 ##   ENABLE_TESTING()
 ##   INCLUDE(CTest)

-set(CTEST_PROJECT_NAME "chrono")
-set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+#set(CTEST_PROJECT_NAME "chrono")
+#set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")

-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=chrono")
-set(CTEST_DROP_SITE_CDASH TRUE)
+#set(CTEST_DROP_METHOD "http")
+#set(CTEST_DROP_SITE "my.cdash.org")
+#set(CTEST_DROP_LOCATION "/submit.php?project=chrono")
+#set(CTEST_DROP_SITE_CDASH TRUE)


cmake fix

cmake fix

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@9018 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/AddCXXCompileOptions.cmake
+++ cmake/AddCXXCompileOptions.cmake
@@ -26,6 +26,8 @@
 if (CMAKE_VERSION VERSION_LESS "3.1")

 if ((CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
+
+    #also: -stdlib=libc++

     # Apple Clang
     if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
@@ -48,7 +50,7 @@
     endif()

 elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-
+
     # LLVM Clang
     if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
       set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
@@ -57,13 +59,13 @@
     endif()

     if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
-      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11 -stdlib=libc++")
+      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
       set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
-      set(CMAKE_CXX_STANDARD_DEFAULT 11)
+      #set(CMAKE_CXX_STANDARD_DEFAULT 11) # travis/gcc4.6
     elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
-      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x -stdlib=libc++")
+      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
       set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
-      set(CMAKE_CXX_STANDARD_DEFAULT 11)
+      #set(CMAKE_CXX_STANDARD_DEFAULT 11)
     endif()

     if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)


Yet another change to support older gits

--- cmake/CMakeModules/FindGit.cmake
+++ cmake/CMakeModules/FindGit.cmake
@@ -86,7 +86,7 @@
     # SET(GIT_SAVED_LC_ALL "$ENV{LC_ALL}")
     # SET(ENV{LC_ALL} C)

-    execute_process(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --max-count 1
+    execute_process(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --max-count=1
       WORKING_DIRECTORY ${dir}
       OUTPUT_VARIABLE ${prefix}_WC_REVISION
       ERROR_VARIABLE git_info_error
@@ -94,7 +94,7 @@
       OUTPUT_STRIP_TRAILING_WHITESPACE)

     IF(NOT ${git_info_result} EQUAL 0)
-      MESSAGE(WARNING "Command \"${GIT_EXECUTABLE} rev-list HEAD --max-count 1\" failed with output:\n${git_info_error}")
+      MESSAGE(WARNING "Command \"${GIT_EXECUTABLE} rev-list HEAD --max-count=1\" failed with output:\n${git_info_error}")
     ELSE(NOT ${git_info_result} EQUAL 0)
 	set(${prefix}_WC_INFO ${git_info_result})
     ENDIF(NOT ${git_info_result} EQUAL 0)


CMake: Reverts usage of `string(APPEND ...)`.

This partially reverts commit 4ce689c8e2be386d0086acce63ce5b8bbab6c34b.

`string(APPEND ...)` was added in CMake 3.4, but the earliest required
version of CMake is 2.8.12.  `list(APPEND ...)` exists in 2.8.12,
so that pattern will not be reverted.

--- cmake/CompilationConfigure.cmake
+++ cmake/CompilationConfigure.cmake
@@ -206,7 +206,7 @@
       "flag. Please use a different C++ compiler.")
   endif (NOT COMPILER_SUPPORTS_CXX11)

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

   # Directory structure for some build artifacts.
   # This is defined for use in tests.
@@ -236,15 +236,15 @@

   # COFF/PE and friends are somewhat limited in the number of sections they
   # allow for an object file. We use this to avoid those problems.
-  string(APPEND CMAKE_CXX_FLAGS
-    " /bigobj -DGOOGLE_GLOG_DLL_DECL= -DCURL_STATICLIB /vd2")
+  set(CMAKE_CXX_FLAGS
+    "${CMAKE_CXX_FLAGS} /bigobj -DGOOGLE_GLOG_DLL_DECL= -DCURL_STATICLIB /vd2")

   # Enable multi-threaded compilation.
-  string(APPEND CMAKE_CXX_FLAGS " /MP")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")

   # Build against the multi-threaded, static version of the runtime library.
-  string(APPEND CMAKE_CXX_FLAGS_DEBUG " /MTd")
-  string(APPEND CMAKE_CXX_FLAGS_RELEASE " /MT")
+  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")

   # Convenience flags to simplify Windows support in C++ source; used to
   # `#ifdef` out some platform-specific parts of Mesos.  We choose to define


cmake: try to workaround gcc -isystem bug

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -100,7 +100,7 @@
 		set_property(TARGET ${testexename}
 				APPEND PROPERTY INCLUDE_DIRECTORIES
 				${ARG_INCLUDE_DIRECTORIES})
-		if (ARG_INCLUDE_SYSTEM_DIRECTORIES)
+		if (ARG_INCLUDE_SYSTEM_DIRECTORIES AND NOT ARG_INCLUDE_SYSTEM_DIRECTORIES STREQUAL "/usr/include")
 			set_property(TARGET ${testexename}
 					APPEND PROPERTY COMPILE_FLAGS
 					"${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${ARG_INCLUDE_SYSTEM_DIRECTORIES}")
@@ -367,7 +367,7 @@
 		${CMAKE_CURRENT_BINARY_DIR} #for readme
 		)

-	if (ARG_INCLUDE_SYSTEM_DIRECTORIES)
+	if (ARG_INCLUDE_SYSTEM_DIRECTORIES AND NOT ARG_INCLUDE_SYSTEM_DIRECTORIES STREQUAL "/usr/include")
 		set_property(TARGET ${PLUGIN_OBJS}
 			APPEND PROPERTY COMPILE_FLAGS
 			"${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${ARG_INCLUDE_SYSTEM_DIRECTORIES} ${CMAKE_PIC_FLAGS}"
@@ -408,7 +408,7 @@
 			${ARG_INCLUDE_DIRECTORIES}
 			${CMAKE_CURRENT_BINARY_DIR} #for readme
 			)
-		if (ARG_INCLUDE_SYSTEM_DIRECTORIES)
+		if (ARG_INCLUDE_SYSTEM_DIRECTORIES AND NOT ARG_INCLUDE_SYSTEM_DIRECTORIES STREQUAL "/usr/include")
 			set_property(TARGET ${PLUGIN_NAME}
 				APPEND PROPERTY COMPILE_FLAGS
 				"${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${ARG_INCLUDE_SYSTEM_DIRECTORIES}"


Qt 5.9 iOS: Fix linkage

Qt 5.9 iOS: Fix linkage

--- cmake/Qt5Core_HunterPlugin.cmake
+++ cmake/Qt5Core_HunterPlugin.cmake
@@ -17,7 +17,9 @@
 endif()

 if(IOS)
-  #
+  if(NOT Qt5Core_VERSION VERSION_LESS 5.9)
+    _qt_cmake_extra_helpers_add_interface(Qt5::Core "-Wl,-e,_qt_main_wrapper")
+  endif()
 elseif(APPLE)
   # _FSCopyAliasInfo
   _qt_cmake_extra_helpers_add_interface(Qt5::Core "-framework CoreServices")


cmake fix NuttX copy

cmake fix NuttX copy

-on the 2nd run this was copying NuttX to NuttX/Nuttx

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -213,8 +213,7 @@
 	# copy
 	add_custom_command(OUTPUT nuttx_copy_${CONFIG}.stamp
 		COMMAND ${MKDIR} -p ${CMAKE_BINARY_DIR}/${CONFIG}
-		COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/NuttX ${nuttx_src}
-		COMMAND ${RM} -rf ${nuttx_src}/.git
+		COMMAND rsync -a --exclude=.git ${CMAKE_SOURCE_DIR}/NuttX/ ${nuttx_src}/
 		COMMAND ${TOUCH} nuttx_copy_${CONFIG}.stamp
 		DEPENDS ${DEPENDS})
 	add_custom_target(__nuttx_copy_${CONFIG}


CMake: sample-based-testing: workaroung clang instrprofile+threading issues.

It appears to break in presence of threading...

--- cmake/sample-based-testing.cmake
+++ cmake/sample-based-testing.cmake
@@ -31,9 +31,18 @@
   list(APPEND REFERENCE_SAMPLE_HASHES "${SAMPLENAME}.hash.failed")
 endforeach()

+set(EXTRA_ENV "")
+if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+   CMAKE_BUILD_TYPE STREQUAL "COVERAGE")
+  message(WARNING "Warning: sample-based-testing; clang instrumentation profile"
+                  " does not work with threading! Will be passing "
+                  "OMP_NUM_THREADS=1 environment variable.")
+  set(EXTRA_ENV "OMP_NUM_THREADS=1")
+endif()
+
 add_custom_target(rstest-create)
 add_custom_command(TARGET rstest-create
-  COMMAND rstest -c ${REFERENCE_SAMPLES}
+  COMMAND "${CMAKE_COMMAND}" -E env ${EXTRA_ENV} "$<TARGET_FILE:rstest>" -c ${REFERENCE_SAMPLES}
   WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Running rstest on all the samples in the sample set to generate the missing hashes"
   VERBATIM
@@ -41,7 +50,7 @@

 add_custom_target(rstest-recreate)
 add_custom_command(TARGET rstest-recreate
-  COMMAND rstest -c -f ${REFERENCE_SAMPLES}
+  COMMAND "${CMAKE_COMMAND}" -E env ${EXTRA_ENV} "$<TARGET_FILE:rstest>" -c -f ${REFERENCE_SAMPLES}
   WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Running rstest on all the samples in the sample set to [re]generate all the hashes"
   VERBATIM
@@ -49,7 +58,7 @@

 add_custom_target(rstest-test) # hashes must exist beforehand
 add_custom_command(TARGET rstest-test
-  COMMAND rstest ${REFERENCE_SAMPLES}
+  COMMAND "${CMAKE_COMMAND}" -E env ${EXTRA_ENV} "$<TARGET_FILE:rstest>" ${REFERENCE_SAMPLES}
   WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Running rstest on all the samples in the sample set to check for regressions"
   VERBATIM
@@ -57,7 +66,7 @@

 add_custom_target(rstest-check) # hashes should exist beforehand if you want to check for regressions
 add_custom_command(TARGET rstest-check
-  COMMAND rstest -f ${REFERENCE_SAMPLES}
+  COMMAND "${CMAKE_COMMAND}" -E env ${EXTRA_ENV} "$<TARGET_FILE:rstest>" -f ${REFERENCE_SAMPLES}
   WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Trying to decode all the samples in the sample set"
   VERBATIM


Use default C++11 support in recent gcc

Use default C++11 support in recent gcc

gcc 6.1 and up use C++14 by default, so no explicit switch for C++11
is required (in fact adding --std=c++11 will break compilation of
packages that require C++14 features, like CGAL 5).

--- cmake_modules/IMPFindC++11.cmake
+++ cmake_modules/IMPFindC++11.cmake
@@ -16,7 +16,12 @@
     execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE
                             GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
     message(STATUS "GCC version: ${GCC_VERSION}")
-    if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+    if (GCC_VERSION VERSION_GREATER 6.1 OR GCC_VERSION VERSION_EQUAL 6.1)
+      # gcc 6.1 and up use C++14 by default, so no explicit switch required
+      # (in fact adding --std=c++11 will break compilation of packages that
+      # require C++14 features, like CGAL 5).
+      message(STATUS "Using g++ C++11 (or later) support")
+    elseif (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
       message(STATUS "Enabling g++ C++11 support")
       set(IMP_CXX11_FLAGS "--std=c++11" CACHE INTERNAL "" FORCE)
     elseif (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)


refactor dependency building. install all of them to the same directory

--- cmake_modules/install_deps.cmake
+++ cmake_modules/install_deps.cmake
@@ -1,34 +1,33 @@
 include(library_suffix)
 include(ExternalProject)

-# Install GFlags
+function(BuildDependency TARGETNAME URL VARNAME LIBNAME)
 ExternalProject_Add(
-    GFlagsLib
-    URL http://google-gflags.googlecode.com/files/gflags-1.7.tar.gz
+    ${TARGETNAME}
+    URL ${URL}
+    INSTALL_DIR ${PROJECT_BINARY_DIR}/deps
     CONFIGURE_COMMAND <SOURCE_DIR>/configure  --prefix=<INSTALL_DIR>
     )
-ExternalProject_Get_Property(GFlagsLib install_dir)
+ExternalProject_Get_Property(${TARGETNAME} install_dir)
 include_directories(${install_dir}/include)
-set(GFLAGS_LIBRARIES ${install_dir}/lib/libgflags.${link_library_suffix})
-set(GFLAGS_PREFIX ${install_dir})
+set(${VARNAME}_LIBRARIES ${install_dir}/lib/${LIBNAME}.${link_library_suffix}
+  PARENT_SCOPE)
+endfunction()

-# Install GLog
-ExternalProject_Add(
-    GLogLib
-    URL http://google-glog.googlecode.com/files/glog-0.3.1-1.tar.gz
-    CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --with-gflags=${GFLAGS_PREFIX}
-    )
-ExternalProject_Get_Property(GLogLib install_dir)
-include_directories(${install_dir}/include)
-set(GLOG_LIBRARIES ${install_dir}/lib/libglog.${link_library_suffix})
+BuildDependency(
+    GFlags
+    http://google-gflags.googlecode.com/files/gflags-1.7.tar.gz
+    GFLAGS
+    libgflags)

-# Install ZeroMQ
-ExternalProject_Add(
+BuildDependency(
+    GLog
+    http://google-glog.googlecode.com/files/glog-0.3.1-1.tar.gz
+    GLOG
+    libglog)
+
+BuildDependency(
     ZeroMQ
-    URL http://download.zeromq.org/zeromq-2.1.11.tar.gz
-    CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --with-gflags=${GFLAGS_PREFIX}
-    )
-ExternalProject_Get_Property(ZeroMQ install_dir)
-include_directories(${install_dir}/include)
-set(ZEROMQ_LIBRARIES ${install_dir}/lib/libzmq.${link_library_suffix})
-
+    http://download.zeromq.org/zeromq-2.1.11.tar.gz
+    ZEROMQ
+    libzmq)


-s and -finline-limit are GCC-specific; -std=c++14 added as a common flag

--- src/cmake/flags.cmake
+++ src/cmake/flags.cmake
@@ -1,9 +1,9 @@
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -finline-limit=150")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14")

 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -ggdb")

-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG -s -flto")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG -flto")
 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")

 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -g3 -DNDEBUG")
@@ -22,3 +22,13 @@

 # fix for gmock/gtest issue...
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
+
+# fix for GCC's performance bug, on inlining heuristics
+if("${CMAKE_CXX_COMPILER}" STREQUAL "g++")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -finline-limit=150")
+endif()
+
+# strip binaries for GCC
+if(${CMAKE_COMPILER_IS_GNUCXX})
+  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+endif()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


fix boost build on mac

fix boost build on mac

--- Projects/boost.cmake
+++ Projects/boost.cmake
@@ -1,8 +1,8 @@
-add_external_project(boost
-  BUILD_IN_SOURCE 1
-  CONFIGURE_COMMAND
-    <SOURCE_DIR>/bootstrap.sh --prefix=<INSTALL_DIR>
-                              --with-libraries=date_time,thread
-  BUILD_COMMAND <SOURCE_DIR>/bjam
-  INSTALL_COMMAND <SOURCE_DIR>/bjam --prefix=<INSTALL_DIR> install
-)
+add_external_project(boost
+  BUILD_IN_SOURCE 1
+  CONFIGURE_COMMAND
+    <SOURCE_DIR>/bootstrap.sh --prefix=<INSTALL_DIR>
+                              --with-libraries=date_time,thread,regex,system
+  BUILD_COMMAND <SOURCE_DIR>/bjam address-model=64 threading=multi
+  INSTALL_COMMAND <SOURCE_DIR>/bjam  address-model=64 threading=multi --prefix=<INSTALL_DIR> install
+)


[cmake][bundle][win] avoid  log flood on 'api-ms-win*.dll' system libs

--- src/cmake/MakeBundle.cmake
+++ src/cmake/MakeBundle.cmake
@@ -1,5 +1,3 @@
-include(BundleUtilities)
-
 # Perform bundle fixup on all executables of an install directory
 # and generates a standalone bundle with all required runtime dependencies.
 #
@@ -7,6 +5,20 @@
 #   - CMAKE_INSTALL_PREFIX: install target path
 #   - BUNDLE_INSTALL_PREFIX: bundle installation path
 #   - BUNDLE_LIBS_PATHS: additional paths (colon separated) to look for runtime dependencies
+
+function(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
+  # avoid log flood for those system libraries with non-absolute path
+  if(item MATCHES "^(api-ms-win-)[^/]+dll")
+    # resolve item with fake absolute system path to keep them identified as system libs
+    # By doing this, fixup_bundle:
+    #   - won't complain about those libraries
+    #   - won't embed them in the bundle
+    set(${resolved_item_var} "$ENV{SystemRoot}/system/${item}" PARENT_SCOPE)
+    set(${resolved_var} TRUE PARENT_SCOPE)
+  endif()
+endfunction()
+
+include(BundleUtilities)

 message(STATUS "Starting Bundle")
 message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")


ENH: Changes required for ITKv5 compatibility

GenericLabelInterpolator needed updates to conform
to receent changes in ITKv5 API.

--- Modules/Remote/GenericLabelInterpolator.remote.cmake
+++ Modules/Remote/GenericLabelInterpolator.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(GenericLabelInterpolator
   "A generic interpolator for multi-label images."
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKGenericLabelInterpolator.git
-  GIT_TAG 161b558c6e700e388d85a5fe07e455dcba4eefaf
+  GIT_TAG 187ab99b7d42718c99e5017f0acd3900d7469bd1
   )


[FIX] Adding fallback for contribs for MinGW builds on 64 bit.

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

--- util/cmake/SeqAnContribs.cmake
+++ util/cmake/SeqAnContribs.cmake
@@ -69,6 +69,13 @@
 			set (SEQAN_CONTRIB_BASE "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
 		endif (IS_DIRECTORY "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
 	endif (NOT DEFINED SEQAN_CONTRIB_BASE)
+    # Try to fall back to x86 on C:\ (MinGW is only available as 32 bit).
+    set (CONTRIB_ARCH "x86")
+    if (NOT DEFINED SEQAN_CONTRIB_BASE)
+        if (IS_DIRECTORY "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+            set (SEQAN_CONTRIB_BASE "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+        endif ()
+    endif ()

 	# Debug help.
     #if (NOT DEFINED SEQAN_CONTRIB_BASE)


Fixed an introduced bug in android project creation.

--- CMake/Utils/AndroidMacros.cmake
+++ CMake/Utils/AndroidMacros.cmake
@@ -39,7 +39,7 @@
 	endif()

-	SET(DEPENDENCIES ${DEPENDENCIES} OgreTerrain OgreRTShaderSystem OgreMeshLodGeneratorStatic OgreOverlay OgrePaging OgreVolume Plugin_ParticleFX Plugin_OctreeSceneManager)
+	SET(DEPENDENCIES ${DEPENDENCIES} OgreTerrain OgreRTShaderSystem OgreMeshLodGenerator OgreOverlay OgrePaging OgreVolume Plugin_ParticleFX Plugin_OctreeSceneManager)
 	add_dependencies(${ANDROID_PROJECT_TARGET} ${DEPENDENCIES})
 	set(DEPEND_STATIC_LIBS "")
 	foreach(DEPENDENCY ${DEPENDENCIES})


Added dciimage library to DCMTK libs

Added dciimage library to DCMTK libs

--- CMakeModules/FindOurDCMTK.cmake
+++ CMakeModules/FindOurDCMTK.cmake
@@ -110,6 +110,31 @@
     /usr/local/dicom/lib
 )

+FIND_PATH( DCMTK_dcmimage_INCLUDE_DIR diregist.h
+    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimage
+    ${DCMTK_DIR}/dcmimage/include
+    ${DCMTK_DIR}/include/dcmimage
+    /usr/local/dicom/include/dcmtk/dcmimage
+    /usr/local/include/dcmtk/dcmimage
+    /usr/include/dcmtk/dcmimage
+    /usr/local/dicom/include/dcmtk/dcmimage
+)
+
+FIND_LIBRARY( DCMTK_dcmimage_LIBRARY dcmimage
+    ${DCMTK_DIR}/dcmimage/libsrc
+    ${DCMTK_DIR}/dcmimage/libsrc/Release
+    ${DCMTK_DIR}/dcmimage/libsrc/Debug
+    ${DCMTK_DIR}/dcmimage/Release
+    ${DCMTK_DIR}/dcmimage/Debug
+    ${DCMTK_DIR}/lib
+    /usr/local/dicom/lib
+    /usr/local/lib64
+    /usr/lib64
+    /usr/local/lib
+    /usr/lib
+    /usr/local/dicom/lib
+)
+
 FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
     ${DCMTK_DIR}/imagectn/libsrc/Release
     ${DCMTK_DIR}/imagectn/libsrc/
@@ -164,7 +189,9 @@
     AND DCMTK_dcmdata_INCLUDE_DIR
     AND DCMTK_dcmdata_LIBRARY
     AND DCMTK_dcmimgle_INCLUDE_DIR
-    AND DCMTK_dcmimgle_LIBRARY )
+    AND DCMTK_dcmimgle_LIBRARY
+    AND DCMTK_dcmimage_INCLUDE_DIR
+    AND DCMTK_dcmimage_LIBRARY )

   SET( DCMTK_FOUND "YES" )
   SET( DCMTK_INCLUDE_DIRS
@@ -172,10 +199,12 @@
     ${DCMTK_ofstd_INCLUDE_DIR}
     ${DCMTK_dcmdata_INCLUDE_DIR}
     ${DCMTK_dcmimgle_INCLUDE_DIR}
+    ${DCMTK_dcmimage_INCLUDE_DIR}
   )

   SET( DCMTK_LIBRARIES
     ${DCMTK_dcmimgle_LIBRARY}
+    ${DCMTK_dcmimage_LIBRARY}
     ${DCMTK_dcmdata_LIBRARY}
     ${DCMTK_ofstd_LIBRARY}
     ${DCMTK_config_LIBRARY}
@@ -186,42 +215,36 @@
    ${DCMTK_LIBRARIES}
    ${DCMTK_imagedb_LIBRARY}
    )
-  ENDIF(DCMTK_imagedb_LIBRARY)
+  ENDIF()

   IF(DCMTK_dcmnet_LIBRARY)
    SET( DCMTK_LIBRARIES
    ${DCMTK_LIBRARIES}
    ${DCMTK_dcmnet_LIBRARY}
    )
-  ENDIF(DCMTK_dcmnet_LIBRARY)
+  ENDIF()

   IF(DCMTK_oflog_LIBRARY)
    SET( DCMTK_LIBRARIES
    ${DCMTK_LIBRARIES}
    ${DCMTK_oflog_LIBRARY}
    )
-  ENDIF(DCMTK_oflog_LIBRARY)
+  ENDIF()

   IF(DCMTK_ofstd_LIBRARY)
    SET( DCMTK_LIBRARIES
    ${DCMTK_LIBRARIES}
    ${DCMTK_ofstd_LIBRARY}
    )
-  ENDIF(DCMTK_ofstd_LIBRARY)
+  ENDIF()

   IF( WIN32 )
     SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
-  ENDIF( WIN32 )
-
-ENDIF( DCMTK_config_INCLUDE_DIR
-    AND DCMTK_ofstd_INCLUDE_DIR
-    AND DCMTK_ofstd_LIBRARY
-    AND DCMTK_dcmdata_INCLUDE_DIR
-    AND DCMTK_dcmdata_LIBRARY
-    AND DCMTK_dcmimgle_INCLUDE_DIR
-    AND DCMTK_dcmimgle_LIBRARY )
+  ENDIF()
+
+ENDIF()

 IF( NOT DCMTK_FOUND )
   SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
   MARK_AS_ADVANCED( DCMTK_DIR )
-ENDIF( NOT DCMTK_FOUND )
+ENDIF()


haskell-cmake-improvements: restore sequential behavior for sandbox added source compilation

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -202,6 +202,7 @@
 										     "${ARG_ADDITIONAL_SOURCES}")

 										# reconfiguration due to Cabal library version issues on stretch
+										install_sandbox_dependencies (DEPENDS c2hs_haskell)
 										add_custom_command (OUTPUT ${PLUGIN_HASKELL_NAME}
 													COMMAND ${CABAL_EXECUTABLE} install ${CABAL_OPTS} --only-dependencies --offline -v0 || true
 												    COMMAND ${CABAL_EXECUTABLE} configure
@@ -320,3 +321,45 @@

 	mark_as_advanced (GHC_FFI_LIB GHC_RTS_LIB GHC_BASE_LIB GHC_GMP_LIB GHC_PRIM_LIB)
 endmacro (add_haskell_plugin)
+
+# ~~~
+# Allows installing sandbox dependencies in a serial manner
+# to avoid cabal concurrency issues https://github.com/haskell/cabal/issues/2220.
+#
+# DEPENDS:
+#  additional targets this call should be dependent on
+# ~~~
+macro (install_sandbox_dependencies)
+	cmake_parse_arguments (ARG
+			       "" # optional keywords
+			       "" # one value keywords
+			       "DEPENDS" # multi value keywords
+			       ${ARGN})
+
+	if (BUILD_SHARED OR BUILD_FULL)
+		set (CABAL_OPTS "--enable-shared")
+	endif (BUILD_SHARED OR BUILD_FULL)
+
+	get_property (HASKELL_SANDBOX_DEP_IDX GLOBAL PROPERTY HASKELL_SANDBOX_DEP_IDX)
+	if (NOT HASKELL_SANDBOX_DEP_IDX)
+		set (HASKELL_SANDBOX_DEP_IDX 1)
+		add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config"
+				    COMMAND ${CABAL_EXECUTABLE} install ${CABAL_OPTS} --only-dependencies --offline -v0 || true
+				    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+				    DEPENDS ${ARG_DEPENDS})
+		set (HASKELL_ADD_SOURCES_TARGET haskell-add-sources-${HASKELL_SANDBOX_DEP_IDX})
+	else (NOT HASKELL_SANDBOX_DEP_IDX)
+		add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config"
+				    COMMAND ${CABAL_EXECUTABLE} install ${CABAL_OPTS} --only-dependencies --offline -v0 || true
+				    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+				    DEPENDS haskell-add-sources-${HASKELL_SANDBOX_DEP_IDX}
+					    ${ARG_DEPENDS})
+		math (EXPR HASKELL_SANDBOX_DEP_IDX "${HASKELL_SANDBOX_DEP_IDX} + 1")
+		set (HASKELL_ADD_SOURCES_TARGET haskell-add-sources-${HASKELL_SANDBOX_DEP_IDX})
+	endif (NOT HASKELL_SANDBOX_DEP_IDX)
+	add_custom_target (${HASKELL_ADD_SOURCES_TARGET} ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config")
+
+	set_property (GLOBAL PROPERTY HASKELL_SANDBOX_DEP_IDX "${HASKELL_SANDBOX_DEP_IDX}")
+endmacro (install_sandbox_dependencies)
+
+


CELIX-418: Added packed configuration for docker executables

--- cmake/cmake_celix/DockerPackaging.cmake
+++ cmake/cmake_celix/DockerPackaging.cmake
@@ -95,7 +95,33 @@
     else ()
         add_custom_command(OUTPUT ${LAUNCHER_SRC}
                 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/celix/gen
-                COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAUNCHER_ORG} ${LAUNCHER_SRC}
+        )
+
+        if (DOCKER_CXX)
+            set(LAUNCHER_STAGE1 "${CMAKE_CURRENT_BINARY_DIR}/${DOCKER_TARGET}-docker-main-stage1.cc")
+        else()
+            set(LAUNCHER_STAGE1 "${CMAKE_CURRENT_BINARY_DIR}/${DOCKER_TARGET}-docker-main-stage1.c")
+        endif()
+
+        file(GENERATE
+                OUTPUT "${LAUNCHER_STAGE1}"
+                CONTENT "#include <celix_launcher.h>
+
+int main(int argc, char *argv[]) {
+    const char * config = \"cosgi.auto.start.1=$<JOIN:$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_BUNDLES>, >\\n\\
+$<JOIN:$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_PROPERTIES>,\\n\\
+>\";
+
+    properties_pt packedConfig = properties_loadFromString(config);
+
+    return celixLauncher_launchWithArgsAndProps(argc, argv, packedConfig);
+}
+"
+        )
+
+        file(GENERATE
+                OUTPUT "${LAUNCHER_SRC}"
+                INPUT "${LAUNCHER_STAGE1}"
         )

         add_executable(${DOCKER_TARGET} ${LAUNCHER_SRC})


Add toolchain 'android-ndk-r10e-api-19-armeabi-v7a-neon-c11'

--- android-ndk-r10e-api-19-armeabi-v7a-neon-c11.cmake
+++ android-ndk-r10e-api-19-armeabi-v7a-neon-c11.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ruslan Baratov
+# Copyright (c) 2015-2017, Ruslan Baratov
 # Copyright (c) 2015, David Hirvonen
 # Copyright (c) 2015, Alexandre Pretyman
 # All rights reserved.
@@ -22,13 +22,14 @@
 polly_init(
     "Android NDK ${ANDROID_NDK_VERSION} / \
 API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \
-NEON / 32-bit ARM / c++11 support / C11"
+NEON / 32-bit ARM / c++11 / c11"
     "Unix Makefiles"
 )

 include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake")

 include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain!
-include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake")

 include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake")
+
+include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake")


Added LLVM/Clang extra warning support in CMake

--- generate/cmake/compiler.cmake
+++ generate/cmake/compiler.cmake
@@ -65,11 +65,10 @@
 set( CLANG_COMPILER_OPTIONS_DEBUG   "${CLANG_ENABLE_CXX_11} ${DEF_GLEW_STATIC_CLANG} ${CLANG_VERBOSE}" )
 set( CLANG_COMPILER_OPTIONS_RELEASE "${CLANG_ENABLE_CXX_11} ${DEF_GLEW_STATIC_CLANG} ${CLANG_VERBOSE}" )

-# TODO
-#if( DEFINED EXTRA_WARNINGS )
-#   set( CLANG_COMPILER_OPTIONS_DEBUG   "<insert here> ${CLANG_COMPILER_OPTIONS_DEBUG}" )
-#   set( CLANG_COMPILER_OPTIONS_RELEASE "<insert here> ${CLANG_COMPILER_OPTIONS_RELEASE}" )
-#endif( DEFINED EXTRA_WARNINGS )
+if( DEFINED EXTRA_WARNINGS )
+   set( CLANG_COMPILER_OPTIONS_DEBUG   "-Werror -Wthread-safety ${CLANG_COMPILER_OPTIONS_DEBUG}" )
+   set( CLANG_COMPILER_OPTIONS_RELEASE "-Werror -Wthread-safety ${CLANG_COMPILER_OPTIONS_RELEASE}" )
+endif( DEFINED EXTRA_WARNINGS )

@@ -112,7 +111,6 @@
 elseif( CMAKE_CXX_COMPILER_ID MATCHES Clang )
    set( CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}   ${CLANG_COMPILER_OPTIONS_DEBUG}" )   # Uncomment this when done with LLVM/Clang
    set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CLANG_COMPILER_OPTIONS_RELEASE}" ) # Uncomment this when done with LLVM/Clang
-   message( WARNING "Extra debug warnings for ${CMAKE_CXX_COMPILER_ID} not (yet) supported" )    # Remove this when done with LLVM/Clang

 elseif( CMAKE_CXX_COMPILER_ID MATCHES Intel )
    #set( CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}   ${INTEL_COMPILER_OPTIONS_DEBUG}" )   # Uncomment this when done with Intel


fixing copy of dlls.

fixing copy of dlls.

--- WkDepends.cmake
+++ WkDepends.cmake
@@ -271,7 +271,7 @@
 		if ( NOT libarg )
 			message ( SEND_ERROR "Error with dependency, needed to run ${target} : ${libarg}" )
 		endif ( NOT libarg )
-		ADD_CUSTOM_COMMAND( TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${depend}>" "$<TARGET_FILE_DIR:${target}>" COMMENT "Copying $<TARGET_FILE:${depend}> to $<TARGET_FILE_DIR:${target}>" )
+		ADD_CUSTOM_COMMAND( TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${libarg}" "$<TARGET_FILE_DIR:${target}>" COMMENT "Copying ${libarg} to $<TARGET_FILE_DIR:${target}>" )
 	endforeach ( libarg ${${depend}_RUN_LIBRARIES} )
 endmacro(WkCopyDepends )


glad is now a static library

glad is now a static library

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -567,7 +567,7 @@
         "<INSTALL_DIR>/${SPIRV_LIB}"
         DEPENDS glad
         CMAKE_ARGS
-          -DGLAD_IS_SHARED=ON
+          -DGLAD_IS_SHARED=OFF
           -DGLAD_PATH=${INSTALL_DIR})

       external_get_property(megamol-shader-factory INSTALL_DIR)


Added compile-time dependency for grpc code generation.

--- contrib/conan/recipes/grpc/gRPCTargets-helpers.cmake
+++ contrib/conan/recipes/grpc/gRPCTargets-helpers.cmake
@@ -42,11 +42,11 @@
           ${target_name} PUBLIC gRPC::grpc++_reflection gRPC::grpc++_unsecure
                                 protobuf::libprotobuf)
         target_sources(${target_name} PRIVATE "${proto_cpp}" "${grpc_cpp}")
-        target_sources(${target_name} PUBLIC "${proto_h}" "${grpc_h}")

       endif()

       target_link_libraries(${ARGV0} PUBLIC ${target_name})
+      add_dependencies(${ARGV0} ${target_name})
     endif()
   endforeach()