Add AppleClang compiler id

Add AppleClang compiler id

--- cmake/PeacockPlatform.cmake
+++ cmake/PeacockPlatform.cmake
@@ -82,7 +82,8 @@
     elseif(peacock_compiler_id STREQUAL "MSVC")
         message(${peacock_compiler_id})
         set(peacock_compiler_id "msvc")
-    elseif(peacock_compiler_id STREQUAL "Clang")
+    elseif((peacock_compiler_id STREQUAL "Clang") OR
+            (peacock_compiler_id STREQUAL "AppleClang"))
         set(peacock_compiler_id "clang")
     elseif(peacock_compiler_id STREQUAL "Intel")
         set(peacock_compiler_id "intel")
@@ -91,7 +92,7 @@
     endif()

-    if((peacock_compiler_id STREQUAL "gcc") OR
+    if((peacock_compiler_id STREQUAL "gcc") OR
             (peacock_compiler_id STREQUAL "mingw") OR
             (peacock_compiler_id STREQUAL "clang"))
         string(FIND ${peacock_compiler_version} "." period_index)


More boost fixes

More boost fixes

--- cmake/ThirdPartyBoost.cmake
+++ cmake/ThirdPartyBoost.cmake
@@ -12,24 +12,32 @@

     # Only build the libraries we need
     SET(BOOST_LIB_LIST --with-system --with-iostreams --with-filesystem
-                       --with-program_options --with-date_time --with-thread
-                       --with-regex)
-
-        IF (NOT WIN32)
-    # We need -fPIC for 64-bit builds
+        --with-program_options --with-date_time --with-thread
+        --with-regex)
+
+    IF (NOT WIN32)
+        # We need -fPIC for 64-bit builds
         IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
             SET(BOOST_FLAGS cxxflags=-fPIC cflags=-fPIC linkflags=-fPIC)
         ENDIF ()
     ENDIF()

-        # Build Boost
+    # Build Boost
     IF (APPLE)
         SET(TOOLSET darwin)
+    ELSEIF (WIN32)
+        IF (MSVC10)
+            SET(TOOLSET msvc-10.0)
+        ELSEIF (MSVC11)
+            SET(TOOLSET msvc-11.0)
+        ELSEIF (MSVC12)
+            SET(TOOLSET msvc-12.0)
+        ENDIF()
     ELSE(APPLE)
         SET(TOOLSET gcc)
     ENDIF(APPLE)
-
-        IF (NOT WIN32)
+
+    IF (NOT WIN32)
         EXTERNALPROJECT_ADD(
             boost
             PREFIX ${TPSRC}
@@ -43,15 +51,20 @@
             INSTALL_DIR ${TPDIST}
             CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ./bootstrap.sh --prefix=${TPDIST}
             BUILD_COMMAND NO_BZIP2=1 ./b2
-                            variant=release
-                            link=shared
-                            include=${TPDIST}/include
-                            linkflags="-L${TPDIST}/lib"
-                            ${BOOST_FLAGS} ${BOOST_LIB_LIST}
-                            --layout=system toolset=${TOOLSET} install
+                variant=release
+                link=shared
+                include=${TPDIST}/include
+                linkflags="-L${TPDIST}/lib"
+                ${BOOST_FLAGS} ${BOOST_LIB_LIST}
+                --layout=system toolset=${TOOLSET} install
             INSTALL_COMMAND ""
-        )
-        ELSE ()
+            )
+    ELSE ()
+        IF (CMAKE_CL_64)
+            SET(ADDRESS_MODEL 64)
+        ELSE()
+            SET(ADDRESS_MODEL 32)
+        ENDIF()
         EXTERNALPROJECT_ADD(
             boost
             PREFIX ${TPSRC}
@@ -65,17 +78,20 @@
             INSTALL_DIR ${TPDIST}
             CONFIGURE_COMMAND call bootstrap.bat
             BUILD_COMMAND b2 variant=release
-                             toolset=msvc-12.0
-                             address-model=32
-                             -s NO_BZIP2=1
-                             -s ZLIB_BINARY=zlib
-                             -s ZLIB_INCLUDE=${TPDIST}/include
-                             -s ZLIB_LIBPATH=${TPDIST}/lib
-                             ${BOOST_LIB_LIST}
-                             --layout=system --prefix=${TPDIST} install
+                toolset=${TOOLSET}
+                address-model=${ADDRESS_MODEL}
+                link=shared
+                runtime-link=shared
+                -s NO_BZIP2=1
+                -s ZLIB_BINARY=zlib
+                -s ZLIB_INCLUDE=${TPDIST}/include
+                -s ZLIB_LIBPATH=${TPDIST}/lib
+                ${BOOST_LIB_LIST}
+                --layout=system
+                --prefix=${TPDIST} install
             INSTALL_COMMAND ""
-        )
-        ENDIF()
+            )
+    ENDIF()

     IF (APPLE)
         EXTERNALPROJECT_ADD_STEP(boost patch-install-path


cmake stop ignoring sign-compare

cmake stop ignoring sign-compare

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -337,7 +337,6 @@
 		-Wuninitialized
 		-Wunused-variable

-		-Wno-sign-compare
 		-Wno-unused-parameter
 		)


Update OpenSSL default version to 1.1.1i

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -110,7 +110,7 @@
 hunter_default_version(OpenCV-Extra VERSION 4.1.1)
 hunter_default_version(OpenEXR VERSION 2.5.1-p0)
 hunter_default_version(OpenNMTTokenizer VERSION 1.11.0-p1)
-hunter_default_version(OpenSSL VERSION 1.1.1g)
+hunter_default_version(OpenSSL VERSION 1.1.1i)
 hunter_default_version(OpenSceneGraph VERSION 3.6.3-p0)
 hunter_default_version(Opus VERSION 1.3.1)
 hunter_default_version(PNG VERSION 1.6.26-p6)


Fixed available build types

Fixed available build types

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

 # Build types
-set(CMAKE_CONFIGURATION_TYPES CACHE STRING "Debug;Release;RelWithDebInfo" FORCE)
+set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo" CACHE STRING "" FORCE)
 if(NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the build type." FORCE)
 endif()


Fix mis-merging in AddLLVM.cmake, take #2. LINK.EXE's options had been broken. Sorry again.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -49,7 +49,7 @@
                    LINK_FLAGS "${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
     else()
       set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                   LINK_FLAGS " ${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+                   LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
     endif()
   endif()


[CMake] Support symlinks even with LLVM_INSTALL_TOOLCHAIN_ONLY

When LLVM_INSTALL_TOOLCHAIN_ONLY is used and LLVM_TOOLCHAIN_TOOLS
contains a tool which is a symlink, it would be ignored. This already
worked before but got broken in r282510.

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1261,11 +1261,11 @@
     set_target_properties(${name} PROPERTIES FOLDER Tools)

     # Make sure both the link and target are toolchain tools
-    if (NOT ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT ${dest} IN_LIST LLVM_TOOLCHAIN_TOOLS)
-      return()
-    endif()
-
-    if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_TOOLS )
+    if (${name} IN_LIST LLVM_TOOLCHAIN_TOOLS AND ${dest} IN_LIST LLVM_TOOLCHAIN_TOOLS)
+      set(TOOL_IS_TOOLCHAIN ON)
+    endif()
+
+    if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS)
       llvm_install_symlink(${name} ${dest})
     endif()
   endif()


Silence resource compiler using /nologo flag.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -286,6 +286,8 @@
     set(ARG_PRODUCT_NAME "LLVM")
   endif()

+  set_property(SOURCE ${resource_file}
+               PROPERTY COMPILE_FLAGS /nologo)
   set_property(SOURCE ${resource_file}
                PROPERTY COMPILE_DEFINITIONS
                "RC_VERSION_FIELD_1=${ARG_VERSION_MAJOR}"


Do not run checks for strtok_r  on Windows - we know the function is not there..

--- cmake/os/WindowsCache.cmake
+++ cmake/os/WindowsCache.cmake
@@ -249,6 +249,7 @@
 SET(HAVE_STRSEP CACHE  INTERNAL "")
 SET(HAVE_STRSIGNAL CACHE  INTERNAL "")
 SET(HAVE_STRSTR 1 CACHE  INTERNAL "")
+SET(HAVE_STRTOK_R CACHE  INTERNAL "")
 SET(HAVE_STRTOL 1 CACHE  INTERNAL "")
 SET(HAVE_STRTOLL CACHE  INTERNAL "")
 SET(HAVE_STRTOUL 1 CACHE  INTERNAL "")


remove web_client_test from plugin.cmake

--- plugins/item_previews/plugin.cmake
+++ plugins/item_previews/plugin.cmake
@@ -1,2 +1 @@
-add_web_client_test(item_previews "${PROJECT_SOURCE_DIR}/plugins/item_previews/plugin_tests/item_previews.js" PLUGIN item_previews)
 add_eslint_test(item_previews "${PROJECT_SOURCE_DIR}/plugins/item_previews/web_client/js")


cmake: Remove dead code 'FindRegex.cmake'

When Zephyr was building the C implementation of KConfig it used the
build script 'FindRegex.cmake' to satisfy a regex dependency.

Now that we no longer use the C implementation of Kconfig we no longer
use this build script, and it is safe to remove it.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- scripts/cmake/FindRegex.cmake
+++ scripts/cmake/FindRegex.cmake
@@ -1,20 +0,0 @@
-find_path(Regex_INCLUDE_DIR NAMES regex.h DOC "libregex include directory")
-mark_as_advanced(Regex_INCLUDE_DIR)
-
-find_library(Regex_LIBRARY "regex" DOC "libregex libraries")
-mark_as_advanced(Regex_LIBRARY)
-
-find_package_handle_standard_args(Regex
-  FOUND_VAR Regex_FOUND
-  REQUIRED_VARS Regex_INCLUDE_DIR
-  FAIL_MESSAGE "Failed to find libregex"
-)
-
-if(Regex_FOUND)
-  set(Regex_INCLUDE_DIRS ${Regex_INCLUDE_DIRS})
-  if(Regex_LIBRARY)
-    set(Regex_LIBRARIES ${Regex_LIBRARY})
-  else()
-    unset(Regex_LIBRARIES)
-  endif()
-endif()


build_system: fix Clang warning

build_system: fix Clang warning

Clang and MSVC are not agreeing on this issue. MSVC complains about an
implicit capture while Clang says it's an unused lambda capture.
For now, we'll ignore the Clang warning.

--- cmake/compiler_flags.cmake
+++ cmake/compiler_flags.cmake
@@ -26,9 +26,9 @@

         set(warnings "${warnings} -Wlogical-op")
     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-        set(warnings "${warnings} -Wno-missing-braces")
+        set(warnings "${warnings} -Wno-missing-braces -Wno-unused-lambda-capture")
     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
-        set(warnings "${warnings} -Wno-missing-braces -Wno-unused-parameter")
+        set(warnings "${warnings} -Wno-missing-braces -Wno-unused-parameter -Wno-unused-lambda-capture")
     endif()

     # Otherwise tinyxml2 complains.


Determine OCTAVE_INCLUDE_PATH and OCTAVE_LIBRARIES.

svn path=/trunk/; revision=7067

--- cmake/modules/octave.cmake
+++ cmake/modules/octave.cmake
@@ -57,6 +57,55 @@
 endif(ENABLE_octave)

 if(ENABLE_octave)
+  #OCTAVE_VERSION is the (dotted triplet) octave version.
+  execute_process(
+  COMMAND ${OCTAVE} --version
+  OUTPUT_VARIABLE _OCTAVE_VERSION
+  )
+  string(REGEX REPLACE
+  "^.*version ([0-9]\\.[0-9]\\.[0-9][0-9]).*$"
+  "\\1"
+  OCTAVE_VERSION
+  ${_OCTAVE_VERSION}
+  )
+  message(STATUS "OCTAVE_VERSION = ${OCTAVE_VERSION}")
+
+  find_path(
+  OCTAVE_INCLUDE_PATH
+  oct.h
+  PATH_SUFFIXES octave-${OCTAVE_VERSION}/octave
+  )
+  message(STATUS "OCTAVE_INCLUDE_PATH = ${OCTAVE_INCLUDE_PATH}")
+
+  find_library(
+  OCTAVE_LIBRARIES
+  octave
+  PATH_SUFFIXES octave-${OCTAVE_VERSION}
+  )
+  message(STATUS "OCTAVE_LIBRARIES = ${OCTAVE_LIBRARIES}")
+
+  if(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES)
+    #Must always have second octave include path which is identical
+    #to the first with trailing "/octave" trimmed off.
+    string(REGEX REPLACE "/octave$" ""
+    octave_include_path_trimmed
+    ${OCTAVE_INCLUDE_PATH}
+    )
+    set(OCTAVE_INCLUDE_PATH
+    ${octave_include_path_trimmed} ${OCTAVE_INCLUDE_PATH}
+    CACHE INTERNAL ""
+    )
+    message(STATUS
+    "(transformed) OCTAVE_INCLUDE_PATH = ${OCTAVE_INCLUDE_PATH}"
+    )
+  else(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES)
+    message(STATUS "WARNING: "
+    "octave headers and/or library not found. Disabling octave bindings")
+    set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
+  endif(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES)
+endif(ENABLE_octave)
+
+if(ENABLE_octave)
   check_perl_modules(PERL_XML_PARSER XML::Parser)
   check_perl_modules(PERL_XML_DOM XML::DOM)
   #MATWRAP is the path+filename of the matwrap script.
@@ -66,19 +115,6 @@
   get_filename_component(MATWRAP_PATH ${MATWRAP} PATH)
   message(STATUS "MATWRAP_PATH = ${MATWRAP_PATH}")

-  #OCTAVE_VERSION is the (dotted triplet) octave version.
-  execute_process(
-  COMMAND ${OCTAVE} --version
-  OUTPUT_VARIABLE _OCTAVE_VERSION
-  )
-  string(REGEX REPLACE
-  "^.*version ([0-9]\\.[0-9]\\.[0-9][0-9]).*$"
-  "\\1"
-  OCTAVE_VERSION
-  ${_OCTAVE_VERSION}
-  )
-  message(STATUS "OCTAVE_VERSION = ${OCTAVE_VERSION}")
-
   # PLPLOT_OCTAVE_DIR is the directory for installation of the PLplot_Octave
   # specific m files
   set(PLPLOT_OCTAVE_DIR ${CMAKE_INSTALL_PREFIX}/share/plplot_octave)


Implement ENABLE_swig_octave option (defaults to OFF) to try to use the
forthcoming SWIG-generated octave bindings rather than the traditional
matwrap-geneated bindings.

svn path=/trunk/; revision=11384

--- cmake/modules/octave.cmake
+++ cmake/modules/octave.cmake
@@ -231,4 +231,5 @@
   if(PL_DOUBLE)
     set(DEFINE_PL_DOUBLE "#define PL_DOUBLE")
   endif(PL_DOUBLE)
-endif(ENABLE_octave)
+  option(ENABLE_swig_octave "Enable Octave bindings generated by SWIG" OFF)
+endif(ENABLE_octave)


Document CMSIS-NN Options. (#9647)

Document CMSIS-NN Options. (#9647)

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -230,6 +230,10 @@

 # Whether to build with Arm(R) Ethos(TM)-U NPU codegen support
 set(USE_ETHOSU OFF)
+
+# Whether to build with CMSIS-NN external library support.
+# See https://github.com/ARM-software/CMSIS_5
+set(USE_CMSISNN OFF)

 # Whether to build with TensorRT codegen or runtime
 # Examples are available here: docs/deploy/tensorrt.rst.


Fix luajit build issues on OSX + refactoring (v2)

Pass sysroot on OSX.
Make the code in luajit.cmake a bit more sane and straightforward.

Note: v1 of this patch was reverted due to performance regression.

--- cmake/luajit.cmake
+++ cmake/luajit.cmake
@@ -129,27 +129,50 @@
 message (STATUS "Use LuaJIT library: ${LUAJIT_LIB}")

 macro(luajit_build)
-    set (luajit_buildoptions BUILDMODE=static)
-    set (luajit_copt "")
-    set (luajit_xcflags "")
+    # Cmake rules concerning strings and lists of strings are weird.
+    #   set (foo "1 2 3") defines a string, while
+    #   set (foo 1 2 3) defines a list.
+    # Use separate_arguments() to turn a string into a list (splits at ws).
+    # It appears that variable expansion rules are context-dependent.
+    # With the current arrangement add_custom_command()
+    # does the right thing. We can even handle pathnames with
+    # spaces though a path with an embeded semicolon or a quotation mark
+    # will most certainly wreak havok.
+    #
+    # This stuff is extremely fragile, proceed with caution.
+    set (luajit_cflags ${CMAKE_C_FLAGS})
+        separate_arguments(luajit_cflags)
+    set (luajut_ldflags ${CMAKE_STATIC_LINKER_FLAGS})
+        separate_arguments(luajit_ldflags)
+    # Use external unwind on all platforms.
+    set (luajit_xcflags "-DLUAJIT_UNWIND_EXTERNAL=1")
+    # We are consciously ommiting debug info in RelWithDebugInfo mode
     if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
-        set (luajit_buildoptions ${luajit_buildoptions} CCDEBUG=${CC_DEBUG_OPT})
-        set (luajit_copt ${luajit_copt} -O1)
+        set (luajit_ccopt -O0)
+        if (CC_HAS_GGDB)
+            set (luajit_ccdebug -g -ggdb)
+        else ()
+            set (luajit_ccdebug -g)
+        endif ()
         set (luajit_xcflags ${luajit_xcflags}
             -DLUA_USE_APICHECK -DLUA_USE_ASSERT)
     else ()
-        set (luajit_copt ${luajit_copt} -O2)
+        set (luajit_ccopt -O2)
+        set (luajit_ccdbebug "")
+    endif()
+    # Pass sysroot settings on OSX
+    if (NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
+        set (luajit_cflags ${luajit_cflags} ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT})
+        set (luajit_ldflags ${luajit_ldlags} ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT})
     endif()
     if (ENABLE_VALGRIND)
         set (luajit_xcflags ${luajit_xcflags}
             -DLUAJIT_USE_VALGRIND -DLUAJIT_USE_SYSMALLOC)
     endif()
-    set (luajit_target_cc "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${CMAKE_C_FLAGS}")
-    # Use external unwind on all platforms.
-    set (luajit_target_cc "${luajit_target_cc} -DLUAJIT_UNWIND_EXTERNAL=1")
+    set (luajit_target_cc ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
     if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
         # Regular mode - use CMake compiler for building host utils.
-        set (luajit_host_cc ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${CMAKE_C_FLAGS})
+        set (luajit_host_cc ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
     else()
         # Crosscompile mode - use a host CC compiler for building host utils.
         # Since CMake does not support cross compilation properly
@@ -161,20 +184,16 @@
         # The host compiler must have same pointer size as the target compiler.
         set (luajit_host_cc "${luajit_host_cc} -m32")
     endif()
-    set(luajit_ldflags "${CMAKE_SHARED_LINKER_FLAGS}")
-    separate_arguments(luajit_copt)
-    separate_arguments(luajit_ldflags)
-    separate_arguments(luajit_host_cc)
-    separate_arguments(luajit_target_cc)
-    set (luajit_buildoptions ${luajit_buildoptions}
-        CFLAGS=""
-        CXXFLAGS=""
+    set (luajit_buildoptions
+        BUILDMODE=static
+        CC="${luajit_host_cc}"
+        CFLAGS="${luajit_cflags}"
+        LDFLAGS="${luajit_ldflags}"
+        CCOPT="${luajit_ccopt}"
+        CCDEBUG="${luajit_ccdebug}"
         XCFLAGS="${luajit_xcflags}"
-        CC="${luajit_host_cc}"
-        HOST_CC="${luajit_host_cc}"
         TARGET_CC="${luajit_target_cc}"
-        CCOPT="${luajit_copt}")
-    set (luajit_buildoptions ${luajit_buildoptions} Q='' LDFLAGS="${luajit_ldflags}")
+        Q='')
     if (${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
         add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/third_party/luajit/src/libluajit.a
             WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/third_party/luajit


refactor AddCompilerFlag to only run a C compiler if the result is needed

Conflicts:
	cmake/AddCompilerFlag.cmake

--- cmake/AddCompilerFlag.cmake
+++ cmake/AddCompilerFlag.cmake
@@ -44,50 +44,39 @@
 macro(AddCompilerFlag _flag)
    string(REGEX REPLACE "[-.+/:= ]" "_" _flag_esc "${_flag}")

-   if("${_flag}" STREQUAL "-mfma")
-      # Compiling with FMA3 support may fail only at the assembler level.
-      # In that case we need to have such an instruction in the test code
-      set(_code "#include <immintrin.h>
-      __m128 foo(__m128 x) { return _mm_fmadd_ps(x, x, x); }
-      int main() { return 0; }")
-      check_c_compiler_flag("${_flag}" check_c_compiler_flag_${_flag_esc} "${_code}")
-      check_cxx_compiler_flag("${_flag}" check_cxx_compiler_flag_${_flag_esc} "${_code}")
-   elseif("${_flag}" STREQUAL "-stdlib=libc++")
-      # Compiling with libc++ not only requires a compiler that understands it, but also
-      # the libc++ headers itself
-      set(_code "#include <iostream>
-      int main() { return 0; }")
-      check_c_compiler_flag("${_flag}" check_c_compiler_flag_${_flag_esc} "${_code}")
-      check_cxx_compiler_flag("${_flag}" check_cxx_compiler_flag_${_flag_esc} "${_code}")
-   else()
-      check_c_compiler_flag("${_flag}" check_c_compiler_flag_${_flag_esc})
-      check_cxx_compiler_flag("${_flag}" check_cxx_compiler_flag_${_flag_esc})
-      if(MIC_NATIVE_FOUND)
-         check_mic_c_compiler_flag("${_flag}" check_mic_c_compiler_flag_${_flag_esc})
-         check_mic_cxx_compiler_flag("${_flag}" check_mic_cxx_compiler_flag_${_flag_esc})
-      endif()
-   endif()
-
-   set(_use_default_flags TRUE)
-   unset(_c_flags)
-   unset(_cxx_flags)
-   unset(_mic_c_flags)
-   unset(_mic_cxx_flags)
+   set(_c_flags "CMAKE_C_FLAGS")
+   set(_cxx_flags "CMAKE_CXX_FLAGS")
+   set(_mic_c_flags "CMAKE_MIC_C_FLAGS")
+   set(_mic_cxx_flags "CMAKE_MIC_CXX_FLAGS")
+   set(_c_result tmp)
+   set(_cxx_result tmp)
+   set(_mic_c_result)
+   set(_mic_cxx_result)
    if(${ARGC} EQUAL 2)
-      set(${ARGV1} "${check_cxx_compiler_flag_${_flag_esc}}")
+      message(WARNING "Deprecated use of the AddCompilerFlag macro.")
+      unset(_c_result)
+      set(_cxx_result ${ARGV1})
    elseif(${ARGC} GREATER 2)
       set(state 0)
       unset(_c_flags)
       unset(_cxx_flags)
       unset(_mic_c_flags)
       unset(_mic_cxx_flags)
+      unset(_c_result)
+      unset(_cxx_result)
+      unset(_mic_c_result)
+      unset(_mic_cxx_result)
       foreach(_arg ${ARGN})
          if(_arg STREQUAL "C_FLAGS")
-            set(_use_default_flags FALSE)
             set(state 1)
+            if(NOT DEFINED _c_result)
+               set(_c_result tmp)
+            endif()
          elseif(_arg STREQUAL "CXX_FLAGS")
-            set(_use_default_flags FALSE)
             set(state 2)
+            if(NOT DEFINED _cxx_result)
+               set(_cxx_result tmp)
+            endif()
          elseif(_arg STREQUAL "C_RESULT")
             set(state 3)
          elseif(_arg STREQUAL "CXX_RESULT")
@@ -97,23 +86,21 @@
          elseif(_arg STREQUAL "MIC_CXX_RESULT")
             set(state 6)
          elseif(_arg STREQUAL "MIC_C_FLAGS")
-            set(_use_default_flags FALSE)
             set(state 7)
          elseif(_arg STREQUAL "MIC_CXX_FLAGS")
-            set(_use_default_flags FALSE)
             set(state 8)
          elseif(state EQUAL 1)
             set(_c_flags "${_arg}")
          elseif(state EQUAL 2)
             set(_cxx_flags "${_arg}")
          elseif(state EQUAL 3)
-            set(${_arg} ${check_c_compiler_flag_${_flag_esc}})
+            set(_c_result "${_arg}")
          elseif(state EQUAL 4)
-            set(${_arg} ${check_cxx_compiler_flag_${_flag_esc}})
+            set(_cxx_result "${_arg}")
          elseif(state EQUAL 5)
-            set(${_arg} ${check_mic_c_compiler_flag_${_flag_esc}})
+            set(_mic_c_result "${_arg}")
          elseif(state EQUAL 6)
-            set(${_arg} ${check_mic_cxx_compiler_flag_${_flag_esc}})
+            set(_mic_cxx_result "${_arg}")
          elseif(state EQUAL 7)
             set(_mic_c_flags "${_arg}")
          elseif(state EQUAL 8)
@@ -123,11 +110,29 @@
          endif()
       endforeach()
    endif()
-   if(_use_default_flags)
-      set(_c_flags "CMAKE_C_FLAGS")
-      set(_cxx_flags "CMAKE_CXX_FLAGS")
-      set(_mic_c_flags "CMAKE_MIC_C_FLAGS")
-      set(_mic_cxx_flags "CMAKE_MIC_CXX_FLAGS")
+
+   if("${_flag}" STREQUAL "-mfma")
+      # Compiling with FMA3 support may fail only at the assembler level.
+      # In that case we need to have such an instruction in the test code
+      set(_code "#include <immintrin.h>
+      __m128 foo(__m128 x) { return _mm_fmadd_ps(x, x, x); }
+      int main() { return 0; }")
+   elseif("${_flag}" STREQUAL "-stdlib=libc++")
+      # Compiling with libc++ not only requires a compiler that understands it, but also
+      # the libc++ headers itself
+      set(_code "#include <iostream>
+      int main() { return 0; }")
+   else()
+      set(_code "int main() { return 0; }")
+   endif()
+
+   if(DEFINED _c_result)
+      check_c_compiler_flag("${_flag}" check_c_compiler_flag_${_flag_esc} "${_code}")
+      set(${_c_result} ${check_c_compiler_flag_${_flag_esc}})
+   endif()
+   if(DEFINED _cxx_result)
+      check_cxx_compiler_flag("${_flag}" check_cxx_compiler_flag_${_flag_esc} "${_code}")
+      set(${_cxx_result} ${check_cxx_compiler_flag_${_flag_esc}})
    endif()

    if(check_c_compiler_flag_${_flag_esc} AND DEFINED _c_flags)
@@ -136,10 +141,22 @@
    if(check_cxx_compiler_flag_${_flag_esc} AND DEFINED _cxx_flags)
       set(${_cxx_flags} "${${_cxx_flags}} ${_flag}")
    endif()
-   if(check_mic_c_compiler_flag_${_flag_esc} AND DEFINED _mic_c_flags)
-      set(${_mic_c_flags} "${${_mic_c_flags}} ${_flag}")
-   endif()
-   if(check_mic_cxx_compiler_flag_${_flag_esc} AND DEFINED _mic_cxx_flags)
-      set(${_mic_cxx_flags} "${${_mic_cxx_flags}} ${_flag}")
+
+   if(MIC_NATIVE_FOUND)
+      if(DEFINED _mic_c_result)
+         check_mic_c_compiler_flag("${_flag}" check_mic_c_compiler_flag_${_flag_esc} "${_code}")
+         set(${_mic_c_result} ${check_mic_c_compiler_flag_${_flag_esc}})
+      endif()
+      if(DEFINED _mic_cxx_result)
+         check_mic_cxx_compiler_flag("${_flag}" check_mic_cxx_compiler_flag_${_flag_esc} "${_code}")
+         set(${_mic_cxx_result} ${check_mic_cxx_compiler_flag_${_flag_esc}})
+      endif()
+
+      if(check_mic_c_compiler_flag_${_flag_esc} AND DEFINED _mic_c_flags)
+         set(${_mic_c_flags} "${${_mic_c_flags}} ${_flag}")
+      endif()
+      if(check_mic_cxx_compiler_flag_${_flag_esc} AND DEFINED _mic_cxx_flags)
+         set(${_mic_cxx_flags} "${${_mic_cxx_flags}} ${_flag}")
+      endif()
    endif()
 endmacro(AddCompilerFlag)


Update FindHinnantDate.cmake script.

Update FindHinnantDate.cmake script.

--- cmake/FindHinnantDate.cmake
+++ cmake/FindHinnantDate.cmake
@@ -13,7 +13,7 @@
 #
 # and the following imported targets::
 #
-#   HinnantDate::Date   - The target to use date.h
+#   HinnantDate::Date   - The target to use date/date.h
 #
 # You can set HinnantDate_ROOT_DIR as hint to the location of the library.
 #
@@ -52,9 +52,11 @@
 set(HinnantDate_NOT_FOUND_MESSAGE "Could NOT find HinnantDate.
 Maybe you need to adjust the search paths or HinnantDate_ROOT_DIR.")

-find_file(HinnantDate_INCLUDE_FILE date.h
-    HINTS ${HinnantDate_ROOT_DIR}
-    PATH_SUFFIXES include include/date
+find_file(HinnantDate_INCLUDE_FILE
+    date/date.h include/date/date.h
+    HINTS
+      ${HinnantDate_ROOT_DIR}
+      ${HinnantDate_ROOT_DIR}/include
 )
 mark_as_advanced(HinnantDate_INCLUDE_FILE)

@@ -70,7 +72,8 @@
         unset(HinnantDate_INCLUDE_FILE CACHE)
     else()
         # Check succeeded, create target
-        get_filename_component(HinnantDate_INCLUDE_DIR "${HinnantDate_INCLUDE_FILE}" DIRECTORY CACHE)
+        get_filename_component(HinnantDate_INCLUDE_DIR "${HinnantDate_INCLUDE_FILE}" DIRECTORY)
+        get_filename_component(HinnantDate_INCLUDE_DIR "${HinnantDate_INCLUDE_DIR}" DIRECTORY)
         mark_as_advanced(HinnantDate_INCLUDE_DIR)
         set(HinnantDate_ROOT_DIR "${HinnantDate_INCLUDE_DIR}")
         unset(HinnantDate_NOT_FOUND_MESSAGE)


Fix build breakage with cmake 2.8

Fix build breakage with cmake 2.8

Change-Id: Ida32c782f6e7bf09bb3f16447be9092c15854986
Reviewed-on: http://review.couchbase.org/42542
Tested-by: Mark Nunberg <e7d42768707bf23038325b0b68d4b577e5f6064a@haskalah.org>
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>

--- cmake/Modules/CopyPDB.cmake
+++ cmake/Modules/CopyPDB.cmake
@@ -1,4 +1,6 @@
-CMAKE_POLICY(SET CMP0026 OLD)
+IF(POLICY CMP0026)
+    CMAKE_POLICY(SET CMP0026 OLD)
+ENDIF()
 MACRO(TRANSFORM_TARGET tname output_pdb output_exp)
     # Base extension name
     GET_FILENAME_COMPONENT(_base "${tname}" NAME_WE)


CMake: add forgotten include(FeatureSummary) into FindPFM.cmake to fix build

Sorry!

--- cmake/Modules/FindPFM.cmake
+++ cmake/Modules/FindPFM.cmake
@@ -3,6 +3,7 @@
 # Set BENCHMARK_ENABLE_LIBPFM to 0 to disable, regardless of libpfm presence.
 include(CheckIncludeFile)
 include(CheckLibraryExists)
+include(FeatureSummary)
 enable_language(C)

 set_package_properties(PFM PROPERTIES


Revert r283029 - [cmake] Make LIT_COMMAND configurable and improve fallback support

Revert the change in r283029 (and the fixup in r283033) due to buildbot
breakage. The fixup is ineffective for the bots that do not force clean
build since the wrong value is already cached in CMakeCache.txt.

Reverting it should result in the cache variable being removed
and therefore it should be possible to re-introduce it after all
buildbots build this revision.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1083,11 +1083,10 @@
   if (NOT CMAKE_CFG_INTDIR STREQUAL ".")
     list(APPEND LIT_ARGS --param build_mode=${CMAKE_CFG_INTDIR})
   endif ()
-  if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
-    set (LIT_COMMAND "${PYTHON_EXECUTABLE};${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py"
-         CACHE STRING "Command used to spawn llvm-lit")
-  else()
-    find_program(LIT_COMMAND NAMES llvm-lit lit.py lit)
+  if (LLVM_MAIN_SRC_DIR)
+    set (LIT_COMMAND ${PYTHON_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
+  else()
+    find_program(LIT_COMMAND llvm-lit)
   endif ()
   list(APPEND LIT_COMMAND ${LIT_ARGS})
   foreach(param ${ARG_PARAMS})


[CMake] Allow custom extensions for externalized debug info

Summary:
Extra flexibility for emitting debug info to external files (remains Darwin only for now).
LLDB needs this functionality to emit a LLDB.framework.dSYM instead of LLDB.dSYM when building the framework, because the latter could conflict with the driver's lldb.dSYM when emitted in the same directory on case-insensitive file systems.

Reviewers: friss, bogner, beanz

Subscribers: mgorny, aprantl, llvm-commits, #lldb

Tags: #llvm

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1604,14 +1604,21 @@
     endif()
   endif()

-  if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
-    if(APPLE)
-      set(output_name "$<TARGET_FILE_NAME:${name}>.dSYM")
+  if(APPLE)
+    if(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION)
+      set(file_ext ${LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION})
+    else()
+      set(file_ext dSYM)
+    endif()
+
+    set(output_name "$<TARGET_FILE_NAME:${name}>.${file_ext}")
+
+    if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
       set(output_path "-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
-    endif()
-  endif()
-
-  if(APPLE)
+    else()
+      set(output_path "-o=${output_name}")
+    endif()
+
     if(CMAKE_CXX_FLAGS MATCHES "-flto"
       OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")


cmake: kconfig: allow to set Kconfig targets externally

This commit allows a project to specify a given set of Kconfig targets
prior to sourcing kconfig.cmake.

This allows for greater flexibility when re-using kconfig.cmake in
other projects.

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

--- cmake/modules/kconfig.cmake
+++ cmake/modules/kconfig.cmake
@@ -149,10 +149,10 @@
   ${ZEPHYR_BASE}/scripts/kconfig/hardenconfig.py
   )

+set_ifndef(KCONFIG_TARGETS menuconfig guiconfig hardenconfig)
+
 foreach(kconfig_target
-    menuconfig
-    guiconfig
-    hardenconfig
+    ${KCONFIG_TARGETS}
     ${EXTRA_KCONFIG_TARGETS}
     )
   add_custom_target(


- Removed temporary cmake message used to help CI-only repro. Not needed now I fixed it. Also renamed a var so it makes more sense when future Harry inevitably has to maintain this garbage

--- cmake/shader_compiler.cmake
+++ cmake/shader_compiler.cmake
@@ -66,13 +66,12 @@
 			add_shader_vulkan()
 		endif()
 		# `output_path` is the path to the built shader (i.e glsl (ogl) or spv (vk)).
-		STRING(REGEX REPLACE "^${CMAKE_SOURCE_DIR}/" "" offset_dir ${output_path})
-		message(WARNING "CI HELPER. \n CMAKE_SOURCE_DIR= ${CMAKE_SOURCE_DIR} \n output_path= ${output_path} \n offset_dir= ${offset_dir}")
+		STRING(REGEX REPLACE "^${CMAKE_SOURCE_DIR}/" "" built_shader_offset_path ${output_path})
 		add_text(
 			TARGET ${ADD_SHADER_TARGET}
 			INPUT_DIR ${PROJECT_SOURCE_DIR}
 			OUTPUT_DIR ${PROJECT_SOURCE_DIR}
-			TEXT_FILES ${offset_dir}
+			TEXT_FILES ${built_shader_offset_path}
 		)

 	endforeach()


support build step custom function

support build step custom function

see issue https://github.com/smanders/externpro/issues/170

--- modules/macpro.cmake
+++ modules/macpro.cmake
@@ -179,6 +179,8 @@
     # build
     if(COMMAND build_${cmdp})
       file(APPEND ${stepBuild} "build_${cmdp}()\n")
+    elseif(DEFINED PRO_${PRO})
+      proCustomBuild(${PRO_${PRO}})
     endif()
     xpMarkdownReadmeAppend(${pro})
   endforeach()
@@ -192,6 +194,14 @@
   list(APPEND xpfiles ${projects})
   xpSourceListAppend("${xpfiles}")
 endmacro()
+
+function(proCustomBuild)
+  set(oneValueArgs BUILD_FUNC)
+  cmake_parse_arguments(X "" "${oneValueArgs}" "" ${ARGN})
+  if(DEFINED X_BUILD_FUNC AND COMMAND ${X_BUILD_FUNC})
+    file(APPEND ${stepBuild} "${X_BUILD_FUNC}()\n")
+  endif()
+endfunction()

 macro(proExecuteStep) # NOTE: called by top-level CMakeLists.txt
   if(${XP_STEP} STREQUAL "mkpatch")


Default now 6.0 unless set explicit.

Default now 6.0 unless set explicit.

--- build_settings.cmake
+++ build_settings.cmake
@@ -74,7 +74,7 @@

 if(VESPA_LLVM_VERSION)
 else()
-set (VESPA_LLVM_VERSION "3.9")
+set (VESPA_LLVM_VERSION "6.0")
 endif()

 if(VESPA_USER)


Rewrote BALLConfigBoost to work with CMake 2.8 as well as 2.6.

--- cmake/BALLConfigBoost.cmake
+++ cmake/BALLConfigBoost.cmake
@@ -1,17 +1,20 @@
-FIND_PACKAGE(Boost COMPONENTS system thread iostreams asio)
+SET(BALL_BOOST_COMPONENTS system thread iostreams asio)
+FIND_PACKAGE(Boost COMPONENTS ${BALL_BOOST_COMPONENTS} QUIET)

 IF (NOT Boost_VERSION) ## we cannot test for Boost_FOUND since this requires all components
 	MESSAGE(SEND_ERROR "Could not find a suitable boost installation! This is a required dependency for BALL! Try setting BOOST_ROOT in ccmake!")
 ELSE()
-	IF (Boost_SYSTEM_FOUND)
-		SET(BALL_HAS_BOOST_SYSTEM TRUE)
-	ENDIF()
-	IF (Boost_THREAD_FOUND)
-		SET(BALL_HAS_BOOST_THREAD TRUE)
-	ENDIF()
-	IF (Boost_IOSTREAMS_FOUND)
-		SET(BALL_HAS_BOOST_IOSTREAMS TRUE)
-	ENDIF()
+	SET(BOOST_LIBRARIES "")
+	FOREACH(COMPONENT ${BALL_BOOST_COMPONENTS})
+		STRING(TOUPPER ${COMPONENT} COMPONENT)
+
+		IF (Boost_${COMPONENT}_FOUND)
+			SET(BALL_HAS_BOOST_${COMPONENT} TRUE)
+			LIST(APPEND BOOST_LIBRARIES ${Boost_${COMPONENT}_LIBRARY})
+		ENDIF()
+	ENDFOREACH()
+
+	## For asio, we have some more work to do...
 	IF (Boost_ASIO_FOUND)
 		SET(BALL_HAS_BOOST_ASIO TRUE)
 		SET(BALL_HAS_ASIO TRUE)
@@ -31,4 +34,3 @@
 		SET(BOOST_INCLUDE_DIRS ${ASIO_INCLUDE_DIR})
 	ENDIF()
 ENDIF()
-


Use dynamic boost libs on Windows.

Use dynamic boost libs on Windows.

--- cmake/BALLConfigBoost.cmake
+++ cmake/BALLConfigBoost.cmake
@@ -1,6 +1,6 @@
 SET(BALL_BOOST_COMPONENTS system thread iostreams regex)
 if ( WIN32 )
-	SET(Boost_USE_STATIC_LIBS ON)
+	SET(BOOST_ALL_DYN_LINK TRUE)
 endif()
 SET(Boost_ADDITIONAL_VERSIONS "1.39" "1.39.0" "1.40" "1.40.0" "1.41" "1.41.0"
 	"1.42" "1.42.0" "1.43" "1.43.0" "1.44.0")


Use /etc/redhat-release when available to pick package type (#967)

* Use /etc/redhat-release when available to pick package type

* Shift some enumerate system logic out of the /etc/issue block

--- cmake/EnumerateSystem.cmake
+++ cmake/EnumerateSystem.cmake
@@ -5,46 +5,49 @@
 if(UNIX)
   if(CMAKE_SYSTEM_NAME MATCHES "Linux")
     set(SPECIFIC_SYSTEM_VERSION_NAME "${CMAKE_SYSTEM_NAME}")
-    if(EXISTS "/etc/issue")
+    if(EXISTS "/etc/redhat-release")
       set(LINUX_NAME "")
-      file(READ "/etc/issue" LINUX_ISSUE)
+      file(READ "/etc/redhat-release" LINUX_ISSUE)
       # Fedora case
       if(LINUX_ISSUE MATCHES "Fedora")
         string(REGEX MATCH "release ([0-9]+)" FEDORA "${LINUX_ISSUE}")
         set(LINUX_NAME "Fedora")
         set(LINUX_VER "${CMAKE_MATCH_1}")
         set(RPM_SYSTEM_NAME "fc${CMAKE_MATCH_1}")
-        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
       endif(LINUX_ISSUE MATCHES "Fedora")
       # CentOS case
       if(LINUX_ISSUE MATCHES "CentOS")
         string(REGEX MATCH "release ([0-9]+)" CENTOS "${LINUX_ISSUE}")
-        set(LINUX_NAME "CentOS")
+        set(LINUX_NAME "CentOS")
         set(LINUX_VER "${CMAKE_MATCH_1}")
         set(RPM_SYSTEM_NAME "rhel${CMAKE_MATCH_1}")
-        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
       endif(LINUX_ISSUE MATCHES "CentOS")
       # Redhat case
       if(LINUX_ISSUE MATCHES "Red Hat")
         string(REGEX MATCH "release ([0-9]+)" REDHAT "${LINUX_ISSUE}")
-        set(LINUX_NAME "Redhat")
+        set(LINUX_NAME "Redhat")
         set(LINUX_VER "${CMAKE_MATCH_1}")
         set(RPM_SYSTEM_NAME "rhel${CMAKE_MATCH_1}")
-        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
       endif(LINUX_ISSUE MATCHES "Red Hat")
+    elseif(EXISTS "/etc/issue")
+      set(LINUX_NAME "")
+      file(READ "/etc/issue" LINUX_ISSUE)
       # Ubuntu case
       if(LINUX_ISSUE MATCHES "Ubuntu")
         string(REGEX MATCH "buntu ([0-9]+\\.[0-9]+)" UBUNTU "${LINUX_ISSUE}")
-        set(LINUX_NAME "Ubuntu")
-        set(LINUX_VER "${CMAKE_MATCH_1}")
-        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "DEB")
-      endif(LINUX_ISSUE MATCHES "Ubuntu")
+        set(LINUX_NAME "Ubuntu")
+        set(LINUX_VER "${CMAKE_MATCH_1}")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "DEB")
+      endif(LINUX_ISSUE MATCHES "Ubuntu")
       # Debian case
       if(LINUX_ISSUE MATCHES "Debian")
         string(REGEX MATCH "Debian .*ux ([0-9]+)" DEBIAN "${LINUX_ISSUE}")
         set(LINUX_NAME "Debian")
-        set(LINUX_VER "${CMAKE_MATCH_1}")
-        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "DEB")
+        set(LINUX_VER "${CMAKE_MATCH_1}")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "DEB")
         if(${LINUX_VER} MATCHES "6")
           set(LINUX_VER "squeeze")
         endif()
@@ -63,43 +66,43 @@
         if(${LINUX_VER} MATCHES "99")
           set(LINUX_VER "unstable")
         endif()
-      endif(LINUX_ISSUE MATCHES "Debian")
+      endif(LINUX_ISSUE MATCHES "Debian")

-      #Find CPU Arch
-      if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "64")
-        set ( BIT_MODE "64")
-      else()
-        set ( BIT_MODE "32")
-      endif ()
+    endif(EXISTS "/etc/redhat-release")

-      #Find CPU Arch for Debian system
-      if ((LINUX_NAME STREQUAL "Debian") OR (LINUX_NAME STREQUAL "Ubuntu"))
+    #Find CPU Arch
+    if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "64")
+      set ( BIT_MODE "64")
+    else()
+      set ( BIT_MODE "32")
+    endif ()

-        # There is no such thing as i686 architecture on debian, you should use i386 instead
-        # $ dpkg --print-architecture
-        FIND_PROGRAM(DPKG_CMD dpkg)
-        IF(NOT DPKG_CMD)
-          # Cannot find dpkg in your path, default to i386
-          # Try best guess
-          if (BIT_MODE STREQUAL "32")
-            SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
-          elseif (BIT_MODE STREQUAL "64")
-            SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64)
-          endif()
-        ENDIF(NOT DPKG_CMD)
-        EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
-          OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
-          OUTPUT_STRIP_TRAILING_WHITESPACE
-          )
-      endif ()
+    #Find CPU Arch for Debian system
+    if ((LINUX_NAME STREQUAL "Debian") OR (LINUX_NAME STREQUAL "Ubuntu"))

-      if(LINUX_NAME)
-        set(SPECIFIC_SYSTEM_VERSION_NAME "${CMAKE_SYSTEM_NAME}-${LINUX_NAME}-${LINUX_VER}")
-      else()
-        set(LINUX_NAME "NOT-FOUND")
-      endif(LINUX_NAME)
+      # There is no such thing as i686 architecture on debian, you should use i386 instead
+      # $ dpkg --print-architecture
+      FIND_PROGRAM(DPKG_CMD dpkg)
+      IF(NOT DPKG_CMD)
+        # Cannot find dpkg in your path, default to i386
+        # Try best guess
+        if (BIT_MODE STREQUAL "32")
+        SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
+        elseif (BIT_MODE STREQUAL "64")
+        SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64)
+        endif()
+      ENDIF(NOT DPKG_CMD)
+      EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
+        OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+        )
+    endif ()

-    endif(EXISTS "/etc/issue")
+    if(LINUX_NAME)
+      set(SPECIFIC_SYSTEM_VERSION_NAME "${CMAKE_SYSTEM_NAME}-${LINUX_NAME}-${LINUX_VER}")
+    else()
+      set(LINUX_NAME "NOT-FOUND")
+    endif(LINUX_NAME)

     string(TOLOWER ${LINUX_NAME} LINUX_NAME_LOWER)
   endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
@@ -109,4 +112,4 @@

 if(WIN32)
   set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "WIX")
-endif()
+endif()


cmake: remove CMake policy CMP0002 and CMP0116

The CMake policies CMP0002 and CMP0116 can now safely be removed.

Setting CMake minimum version to 3.20 ensures that policies are set to
NEW per default for those two policies:
> The cmake_minimum_required() command does more than report an error
> if a too-old version of CMake is used to build a project. It also sets
> all policies introduced in that CMake version or earlier to NEW
> behavior.

CMP0002 was introduced in CMake 2.6 and was set to NEW.

CMP0116 was introduced in CMake 3.20 and set to OLD because of:
> Use the old CMake behaviour until we are updating the CMake 3.20 as
> minimum required. This ensure that CMake >=3.20 will be consistent
> with older CMakes.
and can thus be removed as we are now having 3.20 as minimum required.

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

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -27,16 +27,6 @@
 # Under these restraints we use a second 'cmake_minimum_required'
 # invocation in every toplevel CMakeLists.txt.
 cmake_minimum_required(VERSION 3.20.0)
-
-# CMP0002: "Logical target names must be globally unique"
-cmake_policy(SET CMP0002 NEW)
-
-# Use the old CMake behaviour until we are updating the CMake 3.20 as minimum
-# required. This ensure that CMake >=3.20 will be consistent with older CMakes.
-# CMP0116: Ninja generators transform DEPFILE s from add_custom_command().
-if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.20)
-  cmake_policy(SET CMP0116 OLD)
-endif()

 define_property(GLOBAL PROPERTY ZEPHYR_LIBS
     BRIEF_DOCS "Global list of all Zephyr CMake libs that should be linked in"


[oneDNN] bump up oneDNN to 2.2.2  (#32685)

* - bump up oneDNN to 2.2.2 (should reduce perf drops of mobilenet)

* - more recnet onednn 2.2.2 (some more bugfixes)

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -20,7 +20,8 @@
 SET(MKLDNN_INSTALL_DIR    ${THIRD_PARTY_PATH}/install/mkldnn)
 SET(MKLDNN_INC_DIR        "${MKLDNN_INSTALL_DIR}/include" CACHE PATH "mkldnn include directory." FORCE)
 SET(MKLDNN_REPOSITORY     ${GIT_URL}/oneapi-src/oneDNN.git)
-SET(MKLDNN_TAG            f58682cd8bd0615f41d879f8afc8f1511ab42d24)
+SET(MKLDNN_TAG            f3999b71d8e4415c1985a0dfb812a3ed77ee21fa)
+

 # Introduce variables:
 # * CMAKE_INSTALL_LIBDIR


Disable externel python

Disable externel python

--- cmake/external/python.cmake
+++ cmake/external/python.cmake
@@ -31,6 +31,7 @@
         "please use pip to upgrade protobuf.")
     ENDIF(${PY_GOOGLE.PROTOBUF_VERSION} VERSION_LESS "3.0.0")
 ELSE(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
+    MESSAGE(FATAL_ERROR "Please install python 2.7 before building PaddlePaddle.")
     ##################################### PYTHON ########################################
     SET(PYTHON_SOURCES_DIR ${THIRD_PARTY_PATH}/python)
     SET(PYTHON_INSTALL_DIR ${THIRD_PARTY_PATH}/install/python)


Poco: Added new MongoDB Features

Poco: Added new MongoDB Features

--- cmake/macros/FindPoco.cmake
+++ cmake/macros/FindPoco.cmake
@@ -53,6 +53,7 @@
     set (LIB_FOUNDATION "PocoFoundation")
     set (LIB_NET "PocoNet")
     set (LIB_XML "PocoXML")
+    set (LIB_MONGODB "PocoMongoDB")

 else ()
     if ( POCO_STATIC )
@@ -93,6 +94,20 @@
     ${POCO_LIBRARIES_DIR}
 )

+FIND_LIBRARY(LIB_MONGODB_RELEASE
+  NAMES
+    PocoDataMySQL${POCO_LIBRARIES_EXT} ${LIB_MONGODB}
+  PATHS
+    ${POCO_LIBRARIES_DIR}
+)
+
+FIND_LIBRARY(LIB_MONGODB_DEBUG
+  NAMES
+    PocoDataMySQL${POCO_LIBRARIES_EXT}d ${LIB_MONGODB}
+  PATHS
+    ${POCO_LIBRARIES_DIR}
+)
+
 FIND_LIBRARY(LIB_FOUNDATION_RELEASE
   NAMES
     PocoFoundation${POCO_LIBRARIES_EXT} ${LIB_FOUNDATION}
@@ -139,6 +154,7 @@
     set( POCO_LIBRARIES
         ${LIB_DATA_RELEASE}
         ${LIB_DATA_MYSQL_RELEASE}
+		${LIB_MONGODB_RELEASE}
         ${LIB_FOUNDATION_RELEASE}
         ${LIB_NET_RELEASE}
         ${LIB_XML_RELEASE}
@@ -146,13 +162,14 @@
 else ()
     if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
       set( POCO_LIBRARIES
-        optimized ${LIB_DATA_RELEASE} optimized ${LIB_DATA_MYSQL_RELEASE} optimized ${LIB_FOUNDATION_RELEASE} optimized ${LIB_NET_RELEASE} optimized ${LIB_XML_RELEASE}
-        debug ${LIB_DATA_DEBUG} debug ${LIB_DATA_MYSQL_DEBUG} debug ${LIB_FOUNDATION_DEBUG} debug ${LIB_NET_DEBUG} debug ${LIB_XML_DEBUG}
+        optimized ${LIB_DATA_RELEASE} optimized ${LIB_DATA_MYSQL_RELEASE} optimized ${LIB_MONGODB_RELEASE} optimized ${LIB_FOUNDATION_RELEASE} optimized ${LIB_NET_RELEASE} optimized ${LIB_XML_RELEASE}
+        debug ${LIB_DATA_DEBUG} debug ${LIB_DATA_MYSQL_DEBUG} debug ${LIB_MONGODB_RELEASE} debug ${LIB_FOUNDATION_DEBUG} debug ${LIB_NET_DEBUG} debug ${LIB_XML_DEBUG}
       )
     else()
       set( POCO_LIBRARIES
         ${LIB_DATA_RELEASE}
         ${LIB_DATA_MYSQL_RELEASE}
+		${LIB_MONGODB_RELEASE}
         ${LIB_FOUNDATION_RELEASE}
         ${LIB_NET_RELEASE}
         ${LIB_XML_RELEASE}
@@ -162,12 +179,14 @@

 MARK_AS_ADVANCED(LIB_DATA_RELEASE)
 MARK_AS_ADVANCED(LIB_DATA_MYSQL_RELEASE)
+MARK_AS_ADVANCED(LIB_MONGODB_RELEASE)
 MARK_AS_ADVANCED(LIB_FOUNDATION_RELEASE)
 MARK_AS_ADVANCED(LIB_NET_RELEASE)
 MARK_AS_ADVANCED(LIB_XML_RELEASE)

 MARK_AS_ADVANCED(LIB_DATA_DEBUG)
 MARK_AS_ADVANCED(LIB_DATA_MYSQL_DEBUG)
+MARK_AS_ADVANCED(LIB_MONGODB_DEBUG)
 MARK_AS_ADVANCED(LIB_FOUNDATION_DEBUG)
 MARK_AS_ADVANCED(LIB_NET_DEBUG)
 MARK_AS_ADVANCED(LIB_XML_DEBUG)


allow oevrriding MPIEXEC from an environment varible

--- cmake/modules/FindMPI.cmake
+++ cmake/modules/FindMPI.cmake
@@ -63,6 +63,12 @@
 #
 # Call the system FindMPI.cmake module:
 #
+
+# in case MPIEXEC is specified first call find_program() so that in case of success
+# its subsequent runs inside FIND_PACKAGE(MPI) do not alter the desired result.
+IF(DEFINED ENV{MPIEXEC})
+  FIND_PROGRAM(MPIEXEC $ENV{MPIEXEC})
+ENDIF()

 # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup
 LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)


avoid useless system check on Windows

avoid useless system check on Windows

--- cmake/os/WindowsCache.cmake
+++ cmake/os/WindowsCache.cmake
@@ -57,6 +57,7 @@
 SET(HAVE_FCNTL_NONBLOCK CACHE  INTERNAL "")
 SET(HAVE_FCONVERT CACHE  INTERNAL "")
 SET(HAVE_FDATASYNC CACHE  INTERNAL "")
+SET(HAVE_DECL_FDATASYNC CACHE INTERNAL "")
 SET(HAVE_FENV_H CACHE  INTERNAL "")
 SET(HAVE_FESETROUND CACHE  INTERNAL "")
 SET(HAVE_FGETLN CACHE  INTERNAL "")


remove debug switch

remove debug switch

--- cmake/packages/bundle.cmake
+++ cmake/packages/bundle.cmake
@@ -50,7 +50,7 @@

 add_custom_target(package-arongodb-server-bundle
   COMMAND ${CMAKE_COMMAND} .
-  COMMAND ${CMAKE_CPACK_COMMAND} -G Bundle -C ${CMAKE_BUILD_TYPE} -V --debug
+  COMMAND ${CMAKE_CPACK_COMMAND} -G Bundle -C ${CMAKE_BUILD_TYPE}
   WORKING_DIRECTORY ${PROJECT_BINARY_DIR})

 list(APPEND PACKAGES_LIST package-arongodb-server-bundle)


not installing debug version of TBB

not installing debug version of TBB

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -327,15 +327,15 @@
       SET(EMBREE_INSTALLED_TBB ${CMAKE_INSTALL_LIBDIR}/lib${EMBREE_TBB_LIBRARY_NAME}.so.2)
     ENDIF()
   ENDIF()
-  IF (TBB_DEBUG_FOUND)
-    IF (WIN32)
-      INSTALL(PROGRAMS ${EMBREE_TBB_BIN_DIR}/${EMBREE_TBB_DEBUG_LIBRARY_NAME}.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
-      INSTALL(PROGRAMS ${EMBREE_TBB_LIB_DIR}/${EMBREE_TBB_DEBUG_LIBRARY_NAME}.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
-    ELSEIF (APPLE)
-      INSTALL(PROGRAMS ${EMBREE_TBB_DEBUG_LIBRARY} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
-    ELSE()
-      INSTALL(PROGRAMS ${EMBREE_TBB_DEBUG_LIBRARY}.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
-    ENDIF()
-  ENDIF()
+#  IF (TBB_DEBUG_FOUND)
+#    IF (WIN32)
+#      INSTALL(PROGRAMS ${EMBREE_TBB_BIN_DIR}/${EMBREE_TBB_DEBUG_LIBRARY_NAME}.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
+#      INSTALL(PROGRAMS ${EMBREE_TBB_LIB_DIR}/${EMBREE_TBB_DEBUG_LIBRARY_NAME}.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
+#    ELSEIF (APPLE)
+#      INSTALL(PROGRAMS ${EMBREE_TBB_DEBUG_LIBRARY} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
+#    ELSE()
+#      INSTALL(PROGRAMS ${EMBREE_TBB_DEBUG_LIBRARY}.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
+#    ENDIF()
+#  ENDIF()
 ENDIF()


Compute relative path, fixes #194

Compute relative path, fixes #194

A fixed relative path does not work with multi-level/nested
CMAKE_INSTALL_LIBDIR as with e.g Debian.

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -109,7 +109,7 @@
   SET(EMBREE_RELATIV_ROOT_DIR ".")
 ELSE()
   SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
-  SET(EMBREE_RELATIV_ROOT_DIR "../../..")
+  FILE(RELATIVE_PATH EMBREE_RELATIV_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/")
 ENDIF()
 CONFIGURE_FILE(common/cmake/embree-config.cmake embree-config-install.cmake @ONLY)
 CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cmake @ONLY)


Refix InfiniBand build.

Refix InfiniBand build.

    [ ] May break build
    [ ] May break existing applications (see CHANGES.txt)
    [x] Bugfix
    [ ] New Feature
    [ ] Cleanup
    [ ] Optimization
    [ ] Documentation

Suprisingly rdma_verbs.h is not always there, simply inline the few helper
routines into our codebase.

CMakeLists also needed to be set inline with the plural form of include dirs
found by cmake scripts.

--- FindOFED.cmake
+++ FindOFED.cmake
@@ -1,6 +1,6 @@
 # Copyright (c) 2011-2012 Stefan Eilemann <eile@eyescale.ch>

-find_path(_ofed_INCLUDE_DIR rdma/rdma_verbs.h
+find_path(_ofed_INCLUDE_DIR rdma/rdma_cma.h
   HINTS ${OFED_ROOT}/include
   PATHS /usr/include /usr/local/include /opt/local/include)
 find_library(_rdma_LIBRARY NAMES rdmacm


New version: 0.3.11

New version: 0.3.11

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "3")
-SET(HAWKEY_PATCH "10")
+SET(HAWKEY_PATCH "11")


cmake: Project & IDF git revisions: Show un-annotated tags and -dirty flag

Adds --tags and --dirty flags to cmake git_describe() calls, and not
pass the HEAD commit hash (incompatible with --dirty)

Makes IDF_VER output the same as in Make build system

Thanks to @william-ferguson-au for reporting this:
https://github.com/espressif/esp-idf/issues/3378#event-2355460974

--- tools/cmake/third_party/GetGitRevisionDescription.cmake
+++ tools/cmake/third_party/GetGitRevisionDescription.cmake
@@ -113,7 +113,8 @@
 		${_repo_dir}
 		describe
 		"--always"
-		${hash}
+		"--tags"
+		"--dirty"
 		${ARGN}
 		WORKING_DIRECTORY
 		"${CMAKE_CURRENT_SOURCE_DIR}"


Doxygit: Close header row

Doxygit: Close header row

--- Doxygit.cmake
+++ Doxygit.cmake
@@ -48,7 +48,7 @@
 file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/index.html"
   "
Project	Versions	")
 if(DOXYGIT_PROJECT_EXTRA)
-  file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/index.html" "Status
")
+  file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/index.html" "Status
\n")
 endif()

 macro(DOXYGIT_WRITE_ROW)


[CMake] Fix the Xcode generator

[CMake] Fix the Xcode generator

In PR 5182 I broke the Xcode generator in cases where the output path had ${CMAKE_CFG_INTDIR} in it. This broke because $(CONFIGURATION) is invalid in the name of a target.

Since all targets will have the same value for CMAKE_BINARY_DIR and CMAKE_CFG_INTDIR we can remove those from the target names and still have unique values.

This has the impact of shortening the generated target names so that the filename components are unlikely to hit OS limits using IDE generators where CMake generates Makefiles or scripts for custom commands. It also retains the debug ability that PR 5182 was attempting to add.

--- cmake/modules/SwiftAddCustomCommandTarget.cmake
+++ cmake/modules/SwiftAddCustomCommandTarget.cmake
@@ -122,7 +122,9 @@
   if("${ACCT_CUSTOM_TARGET_NAME}" STREQUAL "")
     # CMake doesn't allow '/' characters in filenames, so replace them with '-'
     list(GET ACCT_OUTPUT 0 output_filename)
-    string(REPLACE "/" "-" target_name "${output_filename}")
+    string(REPLACE "${CMAKE_BINARY_DIR}/" "" target_name "${output_filename}")
+    string(REPLACE "${CMAKE_CFG_INTDIR}/" "" target_name "${target_name}")
+    string(REPLACE "/" "-" target_name "${target_name}")
   else()
     set(target_name "${ACCT_CUSTOM_TARGET_NAME}")
   endif()


Add file dependencies to DFU custom command (#1340)

***NO_CI***

--- CMake/Modules/FindBuildUtils.cmake
+++ CMake/Modules/FindBuildUtils.cmake
@@ -15,6 +15,8 @@

         WORKING_DIRECTORY ${TOOL_HEX2DFU_PREFIX}

+        DEPENDS ${FILE1} ${FILE2}
+
         COMMENT "exporting bin files to DFU image"
     )


Quiet C++14 extension warnings from clang.

--- CMake/hoomd/HOOMDCFlagsSetup.cmake
+++ CMake/hoomd/HOOMDCFlagsSetup.cmake
@@ -26,16 +26,18 @@

     if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

+        set(_common_options "-march=${GCC_ARCH} -Wall -Wno-unknown-pragmas -Wno-c++14-extensions")
+
         # default flags for g++
-        set(CMAKE_C_FLAGS_DEBUG "-march=${GCC_ARCH} -g -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
-        set(CMAKE_C_FLAGS_MINSIZEREL "-march=${GCC_ARCH} -Os -Wall -Wno-unknown-pragmas -DNDEBUG" CACHE STRING "Flags used by the compiler during minimum size release builds." FORCE)
-        set(CMAKE_C_FLAGS_RELEASE "-march=${GCC_ARCH} -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during release builds." FORCE)
-        set(CMAKE_C_FLAGS_RELWITHDEBINFO "-march=${GCC_ARCH} -g -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)
+        set(CMAKE_C_FLAGS_DEBUG "${_common_options} -g" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
+        set(CMAKE_C_FLAGS_MINSIZEREL "${_common_options} -Os -DNDEBUG" CACHE STRING "Flags used by the compiler during minimum size release builds." FORCE)
+        set(CMAKE_C_FLAGS_RELEASE "${_common_options} -O3 -funroll-loops -DNDEBUG" CACHE STRING "Flags used by the compiler during release builds." FORCE)
+        set(CMAKE_C_FLAGS_RELWITHDEBINFO "${_common_options} -g -O3 -funroll-loops -DNDEBUG" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)

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

     elseif(CMAKE_CXX_COMPILER MATCHES "icpc")
         # default flags for intel


Fixed spacing of message

Fixed spacing of message

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@6355 16af8721-9629-0410-8352-f15c8da7e697

--- CMakeModules/FindOpenThreads.cmake
+++ CMakeModules/FindOpenThreads.cmake
@@ -60,6 +60,6 @@
 SET(OPENTHREADS_FOUND "NO")
 IF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)
 	SET(OPENTHREADS_FOUND "YES")
-        MESSAGE("---Found OpenThreads: "${OPENTHREADS_LIBRARY})
+        MESSAGE("-- Found OpenThreads: "${OPENTHREADS_LIBRARY})
 ENDIF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)


New version 2018.9

New version 2018.9

--- Applications/Diffusion/CPackOptions.cmake
+++ Applications/Diffusion/CPackOptions.cmake
@@ -4,9 +4,9 @@
 set(CPACK_PACKAGE_NAME "MITK-Diffusion")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MITK application for processing of MR diffusion imaging data.")
 # Major version is the year of release
-set(CPACK_PACKAGE_VERSION_MAJOR "2017")
+set(CPACK_PACKAGE_VERSION_MAJOR "2018")
 # Minor version is the month of release
-set(CPACK_PACKAGE_VERSION_MINOR "07")
+set(CPACK_PACKAGE_VERSION_MINOR "09")
 # Patch versioning is not intended to be done
 set(CPACK_PACKAGE_VERSION_PATCH "99")


FIX: Removing wrong automerged lines

FIX: Removing wrong automerged lines

--- CMake/ctkMacroBuildQtDesignerPlugin.cmake
+++ CMake/ctkMacroBuildQtDesignerPlugin.cmake
@@ -61,12 +61,6 @@
     QT4_ADD_RESOURCES(MY_QRC_SRCS ${MY_RESOURCES})
   ENDIF()

-  # Add the generated manifest qrc file
-  STRING(REPLACE "_" "." plugin_symbolic_name ${lib_name})
-  ctkMacroGeneratePluginManifest(MY_QRC_SRCS
-    SYMBOLIC_NAME ${plugin_symbolic_name}
-    )
-
   SOURCE_GROUP("Resources" FILES
     ${MY_RESOURCES}
     ${MY_UI_FORMS}


Added return to last line

Added return to last line

--- CMakeModules/OsgDetermineWinVersion.cmake
+++ CMakeModules/OsgDetermineWinVersion.cmake
@@ -19,4 +19,4 @@
             set(${version} "0x${ver}")
         endif(CMAKE_SYSTEM_VERSION)
     endmacro(get_WIN32_WINNT)
-endif(WIN32)+endif(WIN32)


- updated FindCairo.cmake (#1455)

- updated FindCairo.cmake (#1455)

--- Code/cmake/Modules/FindCairo.cmake
+++ Code/cmake/Modules/FindCairo.cmake
@@ -1,48 +1,84 @@
-# - Try to find the cairo library
-# Once done this will define
+# Grabbed from here:
+# https://github.com/adobe/webkit/blob/master/Source/cmake/FindCairo.cmake
 #
-#  CAIRO_FOUND - system has cairo
-#  CAIRO_INCLUDE_DIRS - the cairo include directory
-#  CAIRO_LIBRARIES - Link these to use cairo
+# - Try to find Cairo
+# Once done, this will define
 #
-# Define CAIRO_MIN_VERSION for which version desired.
+#  CAIRO_FOUND - system has Cairo
+#  CAIRO_INCLUDE_DIRS - the Cairo include directories
+#  CAIRO_LIBRARIES - link these to use Cairo
 #
-# grabbed from: https://raw.githubusercontent.com/stevedekorte/io/9c76c405746843087bb94e15c3ef12b9edf041af/modules/FindCairo.cmake
+# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS 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 ITS
+# 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.

-INCLUDE(FindPkgConfig)
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_CAIRO cairo) # FIXME: After we require CMake 2.8.2 we can pass QUIET to this call.

-IF(Cairo_FIND_REQUIRED)
-	SET(_pkgconfig_REQUIRED "REQUIRED")
-ELSE(Cairo_FIND_REQUIRED)
-	SET(_pkgconfig_REQUIRED "")
-ENDIF(Cairo_FIND_REQUIRED)
+FIND_PATH(CAIRO_INCLUDE_DIRS
+    NAMES cairo.h
+    HINTS ${PC_CAIRO_INCLUDEDIR}
+          ${PC_CAIRO_INCLUDE_DIRS}
+    PATH_SUFFIXES cairo
+)

-IF(CAIRO_MIN_VERSION)
-	PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION})
-ELSE(CAIRO_MIN_VERSION)
-	PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo)
-ENDIF(CAIRO_MIN_VERSION)
+FIND_LIBRARY(CAIRO_LIBRARIES
+    NAMES cairo
+    HINTS ${PC_CAIRO_LIBDIR}
+          ${PC_CAIRO_LIBRARY_DIRS}
+)

-IF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
-	FIND_PATH(CAIRO_INCLUDE_DIRS cairo.h)
-	FIND_LIBRARY(CAIRO_LIBRARIES cairo)
+IF (CAIRO_INCLUDE_DIRS)
+    IF (EXISTS "${CAIRO_INCLUDE_DIRS}/cairo-version.h")
+        FILE(READ "${CAIRO_INCLUDE_DIRS}/cairo-version.h" CAIRO_VERSION_CONTENT)

-	# Report results
-	IF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
-		SET(CAIRO_FOUND 1)
-		IF(NOT Cairo_FIND_QUIETLY)
-			MESSAGE(STATUS "Found Cairo: ${CAIRO_LIBRARIES}")
-		ENDIF(NOT Cairo_FIND_QUIETLY)
-	ELSE(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
-		IF(Cairo_FIND_REQUIRED)
-			MESSAGE(SEND_ERROR "Could not find Cairo")
-		ELSE(Cairo_FIND_REQUIRED)
-			IF(NOT Cairo_FIND_QUIETLY)
-				MESSAGE(STATUS "Could not find Cairo")
-			ENDIF(NOT Cairo_FIND_QUIETLY)
-		ENDIF(Cairo_FIND_REQUIRED)
-	ENDIF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
-ENDIF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
+        STRING(REGEX MATCH "#define +CAIRO_VERSION_MAJOR +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}")
+        SET(CAIRO_VERSION_MAJOR "${CMAKE_MATCH_1}")

-# Hide advanced variables from CMake GUIs
-MARK_AS_ADVANCED(CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS)+        STRING(REGEX MATCH "#define +CAIRO_VERSION_MINOR +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}")
+        SET(CAIRO_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+        STRING(REGEX MATCH "#define +CAIRO_VERSION_MICRO +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}")
+        SET(CAIRO_VERSION_MICRO "${CMAKE_MATCH_1}")
+
+        SET(CAIRO_VERSION "${CAIRO_VERSION_MAJOR}.${CAIRO_VERSION_MINOR}.${CAIRO_VERSION_MICRO}")
+    ENDIF ()
+ENDIF ()
+
+# FIXME: Should not be needed anymore once we start depending on CMake 2.8.3
+SET(VERSION_OK TRUE)
+IF (Cairo_FIND_VERSION)
+    IF (Cairo_FIND_VERSION_EXACT)
+        IF ("${Cairo_FIND_VERSION}" VERSION_EQUAL "${CAIRO_VERSION}")
+            # FIXME: Use IF (NOT ...) with CMake 2.8.2+ to get rid of the ELSE block
+        ELSE ()
+            SET(VERSION_OK FALSE)
+        ENDIF ()
+    ELSE ()
+        IF ("${Cairo_FIND_VERSION}" VERSION_GREATER "${CAIRO_VERSION}")
+            SET(VERSION_OK FALSE)
+        ENDIF ()
+    ENDIF ()
+ENDIF ()
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cairo DEFAULT_MSG CAIRO_INCLUDE_DIRS CAIRO_LIBRARIES VERSION_OK)


A few more minor adjustments to be able to find the SDL2 framework on Mac.

--- cmake/FindSDL2.cmake
+++ cmake/FindSDL2.cmake
@@ -69,14 +69,14 @@
 set(_sdl2_framework FALSE)
 # Some special-casing if we've found/been given a framework.
 # Handles whether we're given the library inside the framework or the framework itself.
-if(APPLE AND "${SDL2_LIBRARY}" MATCHES "/([^/]+)\\.framework(/.*)$")
+if(APPLE AND "${SDL2_LIBRARY}" MATCHES "(/[^/]+)*.framework(/.*)?$")
 	set(_sdl2_framework TRUE)
 	set(SDL2_FRAMEWORK "${SDL2_LIBRARY}")
 	# Move up in the directory tree as required to get the framework directory.
-	while("${SDL2_FRAMEWORK}" MATCHES "/([^/]+)\\.framework(/.*)$" AND NOT "${SDL2_FRAMEWORK}" MATCHES "/([^/]+)\\.framework$")
+	while("${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework(/.*)$" AND NOT "${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework$")
 		get_filename_component(SDL2_FRAMEWORK "${SDL2_FRAMEWORK}" DIRECTORY)
 	endwhile()
-	if("${SDL2_FRAMEWORK}" MATCHES "/([^/]+)\\.framework$")
+	if("${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework$")
 		set(SDL2_FRAMEWORK_NAME ${CMAKE_MATCH_1})
 		# If we found a framework, do a search for the header ahead of time that will be more likely to get the framework header.
 		find_path(SDL2_INCLUDE_DIR
@@ -126,28 +126,6 @@
 		PATH_SUFFIXES lib ${SDL2_LIB_PATH_SUFFIX})
 endif()

-if(APPLE)
-	# Need Cocoa here, should always be a framework
-	# Code inspired by similar code in CMake's stock FindGLUT.cmake
-	find_library(SDL2_COCOA_LIBRARY Cocoa)
-
-	list(APPEND SDL2_EXTRA_REQUIRED SDL2_COCOA_LIBRARY)
-	if(SDL2_COCOA_LIBRARY AND NOT TARGET SDL2::Cocoa)
-		add_library(SDL2::Cocoa UNKNOWN IMPORTED)
-		if(SDL2_COCOA_LIBRARY MATCHES "/([^/]+)\\.framework$")
-			# Should always be true, but...
-			# This takes the basename of the framework, without the extension,
-			# and sets it (as a child of the framework) as the imported location for the target.
-			set_target_properties(SDL2::Cocoa PROPERTIES
-				IMPORTED_LOCATION "${SDL2_COCOA_LIBRARY}/${CMAKE_MATCH_1}")
-		else()
-			# Handle the unlikely case Cocoa is just a normal library (or we found the library inside of the framework)
-			set_target_properties(SDL2::Cocoa PROPERTIES
-				IMPORTED_LOCATION "${SDL2_COCOA_LIBRARY}")
-		endif()
-	endif()
-endif()
-
 if(MINGW AND NOT SDL2PC_FOUND)
 	find_library(SDL2_MINGW_LIBRARY mingw32)
 	find_library(SDL2_MWINDOWS_LIBRARY mwindows)
@@ -185,7 +163,7 @@
 				# Handle the case that SDL2 is a framework and we were able to decompose it above.
 				set_target_properties(SDL2::SDL2 PROPERTIES
 					IMPORTED_LOCATION "${SDL2_FRAMEWORK}/${SDL2_FRAMEWORK_NAME}")
-			elseif(_sdl2_framework AND SDL2_LIBRARY MATCHES "/([^/]+)\\.framework$")
+			elseif(_sdl2_framework AND SDL2_LIBRARY MATCHES "(/[^/]+)*.framework$")
 				# Handle the case that SDL2 is a framework and SDL_LIBRARY is just the framework itself.

 				# This takes the basename of the framework, without the extension,
@@ -204,10 +182,16 @@
 			)
 		endif()

-		if(TARGET SDL2::Cocoa)
-			set_property(TARGET SDL2::SDL2 APPEND
-				PROPERTY INTERFACE_LINK_LIBRARIES SDL2::Cocoa)
-		endif()
+        if(APPLE)
+            # Need Cocoa here, is always a framework
+            find_library(SDL2_COCOA_LIBRARY Cocoa)
+            list(APPEND SDL2_EXTRA_REQUIRED SDL2_COCOA_LIBRARY)
+            if(SDL2_COCOA_LIBRARY)
+                set_target_properties(SDL2::SDL2 PROPERTIES
+                        IMPORTED_LINK_INTERFACE_LIBRARIES ${SDL2_COCOA_LIBRARY})
+            endif()
+        endif()
+

 		# Compute what to do with SDL2main
 		set(SDL2MAIN_LIBRARIES SDL2::SDL2)


CMake: Fix output path of C# samples on windows.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -167,12 +167,13 @@
             file (GLOB SOURCE_FILES *.cs)
             if (MSVC)
                 set (URHO3DNET_LIBRARY ${CMAKE_BINARY_DIR}/${DEST_BIN_DIR}/$<CONFIG>/Urho3DNet.dll)
+				set (OUTPUT_FILE ${CMAKE_BINARY_DIR}/${DEST_BIN_DIR}/$<CONFIG>/${TARGET}.exe)
             else ()
                 set (URHO3DNET_LIBRARY ${CMAKE_BINARY_DIR}/${DEST_BIN_DIR}/Urho3DNet.dll)
+				set (OUTPUT_FILE ${CMAKE_BINARY_DIR}/${DEST_BIN_DIR}/${TARGET}.exe)
             endif ()
             # Managed executable must find Urho3DCSharp and Urho3DNet in the same directory, that is why it is put to DEST_BIN_DIR
             # instead of samples directory.
-            set (OUTPUT_FILE ${CMAKE_BINARY_DIR}/${DEST_BIN_DIR}/${TARGET}.exe)
             add_target_csharp(102_CSharpProject /target:exe /reference:System.dll
                 /reference:${URHO3DNET_LIBRARY} /out:${OUTPUT_FILE}
                 ${SOURCE_FILES}


Check for GFORTRAN only if needed.

Check for GFORTRAN only if needed.

--- CMakeModules/FindCLAPACK.cmake
+++ CMakeModules/FindCLAPACK.cmake
@@ -41,16 +41,18 @@
 set(BLA_STATIC TRUE)
 set(LAPACK_STATIC TRUE)

-set(TMP ${CMAKE_FIND_LIBRARY_SUFFIXES})
-set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3)
-find_library( GFORTRAN_LIBRARY
-              NAMES gfortran
-              PATHS ENV LD_LIBRARY_PATH )
-set(CMAKE_FIND_LIBRARY_SUFFIXES ${TMP})
-
-if (GFORTRAN_LIBRARY)
-  set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
-endif ()
+if (LINUX AND NOT APPLE AND NOT DEFINED ENV{MKLROOT})
+  set(TMP ${CMAKE_FIND_LIBRARY_SUFFIXES})
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3)
+  find_library( GFORTRAN_LIBRARY
+                NAMES gfortran
+                PATHS ENV LD_LIBRARY_PATH )
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ${TMP})
+
+  if (GFORTRAN_LIBRARY)
+    set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
+  endif ()
+endif ()

 set(BLA_VENDOR "Apple")
 find_package(LAPACK)


cmake FEATURE coverage checks gcc and gcov versions

--- CMakeModules/GenCoverage.cmake
+++ CMakeModules/GenCoverage.cmake
@@ -38,6 +38,20 @@
     if(GEN_COVERAGE_ENABLED)
         if(NOT CMAKE_COMPILER_IS_GNUCC)
             message(WARNING "Compiler is not gcc! Coverage may break the tests!")
+        endif()
+
+        execute_process(
+            COMMAND bash "-c" "${CMAKE_C_COMPILER} --version | head -n1 | sed \"s/.* (.*) \\([0-9]\\+.[0-9]\\+.[0-9]\\+ .*\\)/\\1/\""
+            OUTPUT_VARIABLE GCC_VERSION_FULL
+            OUTPUT_STRIP_TRAILING_WHITESPACE
+        )
+        execute_process(
+            COMMAND bash "-c" "${PATH_GCOV} --version | head -n1 | sed \"s/.* (.*) \\([0-9]\\+.[0-9]\\+.[0-9]\\+ .*\\)/\\1/\""
+            OUTPUT_VARIABLE GCOV_VERSION_FULL
+            OUTPUT_STRIP_TRAILING_WHITESPACE
+        )
+        if(NOT GCC_VERSION_FULL STREQUAL GCOV_VERSION_FULL)
+            message(WARNING "gcc and gcov versions do not match! Generating coverage may fail with errors.")
         endif()

         # add specific required compile flags


Bugfix

Bugfix

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@28627 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/configure/configure_umfpack.cmake
+++ deal.II/cmake/configure/configure_umfpack.cmake
@@ -35,9 +35,6 @@

 MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED var)

-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${BLAS_LIBRARIES})
-  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
-
   INCLUDE_DIRECTORIES(
     ${UMFPACK_FOLDER}/UMFPACK/Include
     ${UMFPACK_FOLDER}/AMD/Include


Now works on Linux using gcc

Now works on Linux using gcc

--- cmake/External.cmake
+++ cmake/External.cmake
@@ -144,7 +144,7 @@
     endif()
     foreach(BUILD_CONFIG Release;Debug;RelWithDebInfo)
       set(BUILD_AND_INSTALL ${BUILD_AND_INSTALL} COMMAND ${CMAKE_COMMAND} --build ${BUILD_CONFIG} --parallel --config ${BUILD_CONFIG})
-      set(BUILD_AND_INSTALL ${BUILD_AND_INSTALL} COMMAND ${CMAKE_COMMAND} --install ${BUILD_CONFIG} --config ${BUILD_CONFIG})
+      set(BUILD_AND_INSTALL ${BUILD_AND_INSTALL} COMMAND ${CMAKE_COMMAND} --build ${BUILD_CONFIG} --target install --config ${BUILD_CONFIG})

       if(args_BUILD_BYPRODUCTS)
         set(SUFFIX)
@@ -180,7 +180,7 @@

     add_custom_command(OUTPUT "${${lcName}_BINARY_DIR}/EXTERNAL_BUILT"
       COMMAND ${CMAKE_COMMAND} --build . --parallel
-      COMMAND ${CMAKE_COMMAND} --install .
+      COMMAND ${CMAKE_COMMAND} --build . --target install
       COMMAND ${CMAKE_COMMAND} -E touch \"${${lcName}_BINARY_DIR}/EXTERNAL_BUILT\"
       WORKING_DIRECTORY "${${lcName}_BINARY_DIR}"
       ${BYPRODUCTS})


Find GLFW in source builds on Linux

Find GLFW in source builds on Linux

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -33,6 +33,9 @@
     $ENV{PROGRAMFILES}/GLFW/lib
     $ENV{PROGRAMFILES}/GLFW/lib/x64
     $ENV{PROGRAMFILES}/GLFW/lib-msvc120
+    $ENV{GLFW_HOME}/build/src
+    $ENV{GLFW_HOME}/build-debug/src
+    $ENV{GLFW_HOME}/build-release/src
     /usr/lib64
     /usr/local/lib64
     /sw/lib64


add glfw3 to windows section of glfw module

fixes #101

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -109,6 +109,7 @@
                 glfw32
                 glfw32s
                 glfw
+                glfw3
             PATHS
                 ${GLFW_LOCATION}/lib
                 ${GLFW_LOCATION}/lib/x64


CMake 2.6.2 fix

CMake 2.6.2 fix

--- cmake/readline.cmake
+++ cmake/readline.cmake
@@ -197,12 +197,16 @@
     # Handle mutual exclusion of WITH_READLINE/WITH_LIBEDIT variables
     # We save current setting to recognize when user switched between
     # WITH_READLINE and WITH_LIBEDIT
-    IF(WITH_READLINE AND (SAVE_READLINE_SETTING MATCHES "WITH_LIBEDIT"
-      OR NOT SAVE_READLINE_SETTING))
-      SET(WITH_LIBEDIT OFF CACHE BOOL "Use bundled libedit" FORCE)
-    ELSEIF(WITH_LIBEDIT AND (SAVE_READLINE_SETTING MATCHES "WITH_READLINE"
-      OR NOT SAVE_READLINE_SETTING))
-      SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline" FORCE)
+    IF(WITH_READLINE)
+      IF(NOT SAVE_READLINE_SETTING OR SAVE_READLINE_SETTING MATCHES
+         "WITH_LIBEDIT")
+        SET(WITH_LIBEDIT OFF CACHE BOOL "Use bundled libedit" FORCE)
+      ENDIF()
+    ELSEIF(WITH_LIBEDIT)
+      IF(NOT SAVE_READLINE_SETTING OR SAVE_READLINE_SETTING MATCHES
+         "WITH_READLINE")
+        SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline" FORCE)
+      ENDIF()
     ENDIF()

     IF(WITH_READLINE)


new version

new version

--- VERSION.cmake
+++ VERSION.cmake
@@ -46,5 +46,5 @@

 SET(LIBSATSOLVER_MAJOR "0")
 SET(LIBSATSOLVER_MINOR "0")
-SET(LIBSATSOLVER_PATCH "11")
+SET(LIBSATSOLVER_PATCH "12")


Show MITK Player also when ENABLE_TOF_HARDWARE is not set

--- Modules/ToFHardware/mitkToFHardware.cmake
+++ Modules/ToFHardware/mitkToFHardware.cmake
@@ -14,9 +14,10 @@
   ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
 ENDIF(WIN32)

+SET(MITK_TOF_AVAILABLE_CAMERAS MITK Player)
+
 OPTION(MITK_ENABLE_TOF_HARDWARE "Support for range cameras" OFF)
 IF(MITK_ENABLE_TOF_HARDWARE)
-SET(MITK_TOF_AVAILABLE_CAMERAS MITK Player)

 #Begin PMD Camcube hardware
 OPTION(MITK_USE_TOF_PMDCAMCUBE "Enable support for PMD camcube" OFF)


fix glfw install

fix glfw install

--- ext/glfw.cmake
+++ ext/glfw.cmake
@@ -11,38 +11,51 @@
     set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)

 # Download and unpack glfw at configure time
-configure_file(${CMAKE_CURRENT_LIST_DIR}/glfw.CMakeLists.in glfw-download/CMakeLists.txt)
-execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -D "CMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
-            -D "CMAKE_BUILD_TYPE=Release"
-            -D "GLFW_BUILD_EXAMPLES=OFF"
-         "-DGLFW_BUILD_EXAMPLES=OFF"
-        "-DGLFW_BUILD_TESTS=OFF"
+# configure_file(${CMAKE_CURRENT_LIST_DIR}/glfw.CMakeLists.in glfw-download/CMakeLists.txt)
+# execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -D "CMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
+#             -D "CMAKE_BUILD_TYPE=Release"
+#             -D "GLFW_BUILD_EXAMPLES=OFF"
+#          "-DGLFW_BUILD_EXAMPLES=OFF"
+#         "-DGLFW_BUILD_TESTS=OFF"
+#             "-DGLFW_BUILD_DOCS=OFF"
+#   RESULT_VARIABLE result
+#   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glfw-download )
+# if(result)
+#   message(FATAL_ERROR "CMake step for glfw failed: ${result}")
+# endif()
+# execute_process(COMMAND ${CMAKE_COMMAND} --build .
+#   RESULT_VARIABLE result
+#   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glfw-download )
+# if(result)
+#   message(FATAL_ERROR "Build step for glfw failed: ${result}")
+# endif()
+
+include(ExternalProject)
+ExternalProject_Add(
+    glfw PREFIX glfw
+    URL "https://github.com/glfw/glfw/archive/3.3.tar.gz"
+	SOURCE_DIR        "${CMAKE_CURRENT_BINARY_DIR}/glfw-src"
+	BINARY_DIR        "${CMAKE_CURRENT_BINARY_DIR}/glfw-build"
+	# CONFIGURE_COMMAND ""
+	# BUILD_COMMAND     ""
+	# INSTALL_COMMAND   ""
+	# TEST_COMMAND      ""
+    CMAKE_ARGS
+            "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
+            "-DCMAKE_BUILD_TYPE=Release"
+            "-DGLFW_BUILD_EXAMPLES=OFF"
+            "-DGLFW_BUILD_TESTS=OFF"
             "-DGLFW_BUILD_DOCS=OFF"
-  RESULT_VARIABLE result
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glfw-download )
-if(result)
-  message(FATAL_ERROR "CMake step for glfw failed: ${result}")
-endif()
-execute_process(COMMAND ${CMAKE_COMMAND} --build .
-  RESULT_VARIABLE result
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glfw-download )
-if(result)
-  message(FATAL_ERROR "Build step for glfw failed: ${result}")
-endif()
+    CMAKE_CACHE_ARGS
+        "-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}"
+        "-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}"
+    )

-# Add glfw directly to our build. This defines
-# the gtest and gtest_main targets.
-add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/glfw-src
-                 ${CMAKE_CURRENT_BINARY_DIR}/glfw-build
-                 EXCLUDE_FROM_ALL)
+    ExternalProject_Get_Property(glfw INSTALL_DIR)

+   set(GLFW_INCLUDE_DIR ${INSTALL_DIR}/include)
+   set(GLFW_LIBRARIES ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}glfw3${CMAKE_STATIC_LIBRARY_SUFFIX})

-   set(GLFW_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/glfw-src/include)
-   set(GLFW_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/glfw-build/src/${CMAKE_STATIC_LIBRARY_PREFIX}glfw3${CMAKE_STATIC_LIBRARY_SUFFIX})
-
-	# set(GLFW_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/glfw-src/include")
-	# set(GLFW_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/glfw-build/src/Debug/glfw3.lib")
-    # set(GLFW_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/glfw-build/src/glfw3.lib")

 	if(UNIX)
         find_package(Threads REQUIRED)
@@ -100,12 +113,18 @@
 set(GLFW_LIBRARIES ${GLFW_LIBRARIES} CACHE STRING "")

 install(DIRECTORY
-        ${GLFW_INCLUDE_DIR}/GLFW
+        ${INSTALL_DIR}/include/GLFW
         DESTINATION ${INSTALL_PATH}/include
         FILES_MATCHING REGEX "(.*\\.[inl|h])")
-if(glfw)
-install(TARGETS glfw
-        LIBRARY DESTINATION ${INSTALL_PATH}/lib
-        ARCHIVE DESTINATION ${INSTALL_PATH}//lib
-        )
-endif(glfw)
+# if(glfw)
+# install(TARGETS glfw
+#         LIBRARY DESTINATION ${INSTALL_PATH}/lib
+#         ARCHIVE DESTINATION ${INSTALL_PATH}//lib
+#         )
+
+install(FILES
+   ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}glfw3${CMAKE_STATIC_LIBRARY_SUFFIX}
+        DESTINATION ${INSTALL_PATH}/lib
+)
+
+# endif(glfw)


PKG: rename otbIceViewer.exe -> iceViewer.exe

--- CMake/MinGWPackage.cmake
+++ CMake/MinGWPackage.cmake
@@ -27,8 +27,8 @@
     list(APPEND PACKAGE_PEFILES "${OTB_INSTALL_DIR}/bin/otbApplicationLauncherCommandLine.exe")
     list(APPEND PACKAGE_PEFILES "${OTB_INSTALL_DIR}/bin/otbApplicationLauncherQt.exe") #OTBQtWidget must exists when you are building OTB

-    if(EXISTS "${OTB_INSTALL_DIR}/bin/otbIceViewer.exe")
-      list(APPEND PACKAGE_PEFILES "${OTB_INSTALL_DIR}/bin/otbIceViewer.exe") #iceviewer
+    if(EXISTS "${OTB_INSTALL_DIR}/bin/iceViewer.exe")
+      list(APPEND PACKAGE_PEFILES "${OTB_INSTALL_DIR}/bin/iceViewer.exe") #iceviewer
     endif()
   endif()


BUG: Fix vtk_module_config for repeated calls

Fix use of _${ns}_${mod}_USED settings to block reporting a module more
than once in a single vtk_module_config call.  Do not leak the
_${ns}_${mod}_USED settings outside a single call to vtk_module_config
so that a future call to the macro with the same ${ns} will use a fresh
set of modules.

Reported-by: Andrew Maclean <c9b2f5a1dba95786ee62d836bcc66ea197719bbe@gmail.com>
Reported-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>
Change-Id: Ib37717f5724ad94e20c14165886a0d023fcecd9c

--- CMake/vtkModuleAPI.cmake
+++ CMake/vtkModuleAPI.cmake
@@ -4,8 +4,9 @@
 # Private helper macros.

 macro(_vtk_module_config_recurse ns mod)
-  if(NOT _${ns}_${dep}_USED)
+  if(NOT _${ns}_${mod}_USED)
     set(_${ns}_${mod}_USED 1)
+    list(APPEND _${ns}_USED_MODULES ${mod})
     vtk_module_load("${mod}")
     list(APPEND ${ns}_LIBRARIES ${${mod}_LIBRARIES})
     list(APPEND ${ns}_INCLUDE_DIRS ${${mod}_INCLUDE_DIRS})
@@ -108,9 +109,16 @@
   set(${ns}_INCLUDE_DIRS "")
   set(${ns}_LIBRARY_DIRS "")
   set(_${ns}_AUTOINIT "")
+
+  set(_${ns}_USED_MODULES "")
   foreach(mod ${ARGN})
     _vtk_module_config_recurse("${ns}" "${mod}")
   endforeach()
+  foreach(mod ${_${ns}_USED_MODULES})
+    unset(_${ns}_${mod}_USED)
+  endforeach()
+  unset(_${ns}_USED_MODULES)
+
   foreach(v ${ns}_LIBRARIES ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS
            _${ns}_AUTOINIT)
     if(${v})


Update CTK to current master

Update CTK to current master

Summary: Necessary because only the newest CTK version is python 3 compatible

Test Plan: covered by current tests. successful builds on ubuntu und windows 10

Reviewers: O1 MITK Core, kislinsk

Reviewed By: O1 MITK Core, kislinsk

Maniphest Tasks: T26467

Differential Revision: https://phabricator.mitk.org/D208

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag b93e8dca)
+    set(revision_tag da3fd76)

     set(ctk_optional_cache_args )
     if(MITK_USE_Python)
@@ -58,7 +58,7 @@
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 C86289F25E79B0C5C12E424BD706388F
+      URL_MD5 A413BE11D3E9970E0EBB71181A5F2B90
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


try libboost-python dependency

try libboost-python dependency

--- src/deb/package_details.cmake
+++ src/deb/package_details.cmake
@@ -17,7 +17,8 @@
 # natty/maverick has 1.42.0
 # lucid has 1.40.0
 set(DEBSRC_PACKAGE_DEPENDS python git cmake
-                "libboost-python1.48.0 | libboost-python1.46.1 | libboost-python1.42.0 | libboost-python1.40.0"
+                #"libboost-python1.48.0 | libboost-python1.46.1 | libboost-python1.42.0 | libboost-python1.40.0"
+                libboost-python
                 libgomp1 CACHE STRING "name")

 # however CPack wants dependencies as a single comma separated string!
@@ -44,16 +45,8 @@
 SET(CPACK_PACKAGE_VERSION ${MY_VERSION} CACHE STRING "name8")
 set(CPACK_DEBIAN_DISTRIBUTION_NAME ubuntu CACHE STRING "name9")

+set(CPACK_DEBIAN_DISTRIBUTION_RELEASES lucid maverick natty oneiric precise quantal CACHE STRING "name10")

-message(STATUS " dist rel is : ${MY_DISTRIBUTION_RELEASES}")
-
-if ( ${MY_DISTRIBUTION_RELEASES} MATCHES "oneiric")
-    set(CPACK_DEBIAN_DISTRIBUTION_RELEASES "")
-    set(CPACK_DEBIAN_DISTRIBUTION_RELEASES oneiric CACHE STRING "name10")
-
-else()
-    set(CPACK_DEBIAN_DISTRIBUTION_RELEASES lucid maverick natty oneiric precise quantal CACHE STRING "name10")
-endif()
 message(STATUS " CPACK_DEBIAN_DISTRIBUTION_RELEASES : ${CPACK_DEBIAN_DISTRIBUTION_RELEASES}")

 message(STATUS " CMAKE_SOURCE_DIR is = " ${CMAKE_SOURCE_DIR})


Bump to 1.7.15

Bump to 1.7.15

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(LIBREPO_MAJOR "1")
 SET(LIBREPO_MINOR "7")
-SET(LIBREPO_PATCH "14")
+SET(LIBREPO_PATCH "15")


need boost::filesystem along with boost::iostreams

--- projects/boost.cmake
+++ projects/boost.cmake
@@ -264,7 +264,7 @@
     runtime-link=${boost_RUNTIME_LINK} toolset=${boost_TOOLSET} ${boost_FLAGS}
     )
   #list(APPEND boost_BUILD --without-locale --without-mpi)
-  list(APPEND boost_BUILD --with-iostreams)
+  list(APPEND boost_BUILD --with-iostreams --with-filesystem)
   list(APPEND boost_BUILD -s ZLIB_BINARY=zlibstatic-s -s ZLIB_INCLUDE=${STAGE_DIR}/include/zlib -s ZLIB_LIBPATH=${STAGE_DIR}/lib)
   if(${CMAKE_SYSTEM_NAME} STREQUAL SunOS)
     # Memory exhausted errors (/opt/csw/i386-pc-solaris2.10/bin/ranlib)


[Build] add some traces in CTestDriver

[Build] add some traces in CTestDriver

--- Build/CTestDriver.cmake
+++ Build/CTestDriver.cmake
@@ -18,12 +18,23 @@

 # here we should have all Siconos sources
 set(CMAKE_MODULE_PATH ${SOURCE_DIRECTORY}/${MODULE}/cmake)
+set(CTEST_MODULE_PATH ${SOURCE_DIRECTORY}/${MODULE}/cmake)
+
+message(STATUS "MODULE is: ${MODULE}")
+message(STATUS "MODE is: ${MODE}")
+message(STATUS "SOURCE_DIRECTORY is: ${SOURCE_DIRECTORY}")
+message(STATUS "BINARY_DIRECTORY is: ${BINARY_DIRECTORY}")x
+
+message(STATUS "cmake module path is: ${CMAKE_MODULE_PATH}")
+

 if(NOT BUILD_TYPE)
   set(CTEST_BUILD_CONFIGURATION "Profiling")
 else()
   set(CTEST_BUILD_CONFIGURATION ${BUILD_TYPE})
 endif()
+
+message(STATUS "BUILD_TYPE is: ${CTEST_BUILD_CONFIGURATION}")

 set(CMAKE_BUILD_TYPE ${CTEST_BUILD_CONFIGURATION})
 set(CMAKE_SOURCE_DIR ${SOURCE_DIRECTORY})


Add test label for language

Add test label for language

Adding ctest property to for each (non-C++) language test via the
centralized macros. This enable only tests for certain languages to be
run.

--- CMake/sitkAddTest.cmake
+++ CMake/sitkAddTest.cmake
@@ -57,6 +57,9 @@
     ${ARGN}
     )
   set_property(TEST Python.${name}
+      PROPERTY LABELS Python
+      )
+  set_property(TEST Python.${name}
       PROPERTY ENVIRONMENT SITK_NOSHOW=YES
       )
   if (NOT SimpleITK_PYTHON_USE_VIRTUALENV)
@@ -91,6 +94,9 @@
     ${ARGN}
     )
   set_property(TEST Lua.${name}
+    PROPERTY LABELS Lua
+    )
+  set_property(TEST Lua.${name}
     PROPERTY ENVIRONMENT LUA_CPATH=$<TARGET_FILE:SimpleITKLuaModule_LUA>
     )
   set_property(TEST Lua.${name}
@@ -121,7 +127,9 @@
     ${command}
     ${ARGN}
     )
-
+  set_property(TEST Ruby.${name}
+    PROPERTY LABELS Ruby
+    )
   set_property(TEST Ruby.${name}
     PROPERTY ENVIRONMENT RUBYLIB=$<TARGET_FILE_DIR:simpleitk_RUBY>
     )
@@ -149,6 +157,9 @@
     COMMAND "${ITK_TEST_DRIVER}"
     ${command}
     ${ARGN}
+    )
+  set_property(TEST Tcl.${name}
+    PROPERTY LABELS Tcl
     )
 endfunction()

@@ -203,6 +214,9 @@
     "${_java_class}"
     ${ARGN}
     )
+  set_property(TEST Java.${name}
+    PROPERTY LABELS Java
+    )
 endfunction()

@@ -228,7 +242,9 @@
     ${command}
     ${ARGN}
     )
-
+  set_property(TEST R.${name}
+    PROPERTY LABELS R
+    )
   set_property(TEST R.${name}
     PROPERTY ENVIRONMENT R_LIBS=${SimpleITK_BINARY_DIR}/Wrapping/R/R_libs/
     )
@@ -285,5 +301,7 @@
       ${ARGN}
       )
   endif()
-
-endfunction()
+  set_property(TEST CSharp.${name}
+    PROPERTY LABELS CSharp
+    )
+endfunction()


- валидация хедеров

 - валидация хедеров

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@12247 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/build.version.cmake
+++ rdo/packages/cmake/trunk/build.version.cmake
@@ -1,6 +1,13 @@
-#ifndef RDO_STUDIO_RES_BUILD_VERSION_H
-#define RDO_STUDIO_RES_BUILD_VERSION_H
+// ----------------------------------------------------------------------- INCLUDES
+#include "utils/src/common/warning_disable.h"
+#include <QString>
+#include "utils/src/common/warning_enable.h"
+// ----------------------------------------------------------------------- SYNOPSIS
+// --------------------------------------------------------------------------------
+
+#ifndef _RDO_STUDIO_RES_BUILD_VERSION_H_
+#define _RDO_STUDIO_RES_BUILD_VERSION_H_

 static const QString g_buildVersion("${CMAKE_SVN_VERSION}");

-#endif // RDO_STUDIO_RES_BUILD_VERSION_H
+#endif // _RDO_STUDIO_RES_BUILD_VERSION_H_


SVN_SILENT made messages (.desktop file)

--- plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
+++ plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
@@ -2,8 +2,10 @@
 Encoding=UTF-8
 Comment=Custom account configuration user interface for accounts using the Morse connection manager.
 Comment[cs]=Vlastní uživatelské rozhraní nastavení účtů pro účty používající správce spojení Morse.
+Comment[da]=Brugerflade til brugertilpasset kontokonfiguration til konti der bruger forbindelseshåndteringen Morse.
 Comment[de]=Eigene Benutzeroberfläche zum Einrichten von Zugängen, die die Morse-Verbindungsverwaltung verwenden.
 Comment[en_GB]=Custom account configuration user interface for accounts using the Morse connection manager.
+Comment[fr]=Interface utilisateur personnalisée pour la configuration de comptes en utilisant le gestionnaire de connexions « Morse ».
 Comment[it]=Interfaccia utente personalizzata di configurazione account per account che usano il gestore di connessioni Morse.
 Comment[nl]=Gebruikersinterface voor aangepaste accountconfiguratie voor accounts die de Morse verbindingenbeheerder gebruiken.
 Comment[pt]=Interface de utilizador de configuração de contas personalizadas com o gestor de ligações Morse.


Fixed size reporting for eeproms, minor code cleanup

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -517,6 +517,7 @@
 # see documentation at top
 #=============================================================================#
 function(GENERATE_AVR_FIRMWARE INPUT_NAME)
+    # TODO: This is not optimal!!!!
     message(STATUS "Generating ${INPUT_NAME}")
     parse_generator_arguments(${INPUT_NAME} INPUT
                               "NO_AUTOLIBS;MANUAL"            # Options
@@ -722,26 +723,6 @@
     error_for_unparsed(${PREFIX})
     load_generator_settings(${TARGET_NAME} ${PREFIX} ${OPTIONS} ${ARGS} ${MULTI_ARGS})
 endmacro()
-
-#=============================================================================#
-# [PRIVATE/INTERNAL]
-#
-# load_board_settings()
-#
-# Load the Arduino SDK board settings from the boards.txt file.
-#
-#=============================================================================#
-#function(LOAD_BOARD_SETTINGS)
-#    load_arduino_style_settings(ARDUINO_BOARDS "${ARDUINO_BOARDS_PATH}")
-#endfunction()
-
-#=============================================================================#
-# [PRIVATE/INTERNAL]
-#
-#=============================================================================#
-#function(LOAD_PROGRAMMERS_SETTINGS)
-#    load_arduino_style_settings(ARDUINO_PROGRAMMERS "${ARDUINO_PROGRAMMERS_PATH}")
-#endfunction()

 #=============================================================================#
 # [PRIVATE/INTERNAL]
@@ -915,9 +896,11 @@
                 message(FATAL_ERROR "Invalid source file: ${SRC}")
             endif()
             file(STRINGS ${SRC} SRC_CONTENTS)
+
             foreach(LIBNAME ${ARDLIBS})
                 list(APPEND SRC_CONTENTS "#include <${LIBNAME}.h>")
             endforeach()
+
             foreach(SRC_LINE ${SRC_CONTENTS})
                 if("${SRC_LINE}" MATCHES "^ *#include *[<\"](.*)[>\"]")
                     get_filename_component(INCLUDE_NAME ${CMAKE_MATCH_1} NAME_WE)
@@ -1843,7 +1826,7 @@
         set(AVRSIZE_PROGRAM ${AVRSIZE_PROGRAM})
         set(AVRSIZE_FLAGS -C --mcu=\${MCU})

-        execute_process(COMMAND \${AVRSIZE_PROGRAM} \${AVRSIZE_FLAGS} \${FIRMWARE_IMAGE}
+        execute_process(COMMAND \${AVRSIZE_PROGRAM} \${AVRSIZE_FLAGS} \${FIRMWARE_IMAGE} \${EEPROM_IMAGE}
                         OUTPUT_VARIABLE SIZE_OUTPUT)

@@ -1882,18 +1865,29 @@
         list(LENGTH SIZE_OUTPUT_LINES SIZE_OUTPUT_LENGTH)
         #message(\"\${SIZE_OUTPUT_LINES}\")
         #message(\"\${SIZE_OUTPUT_LENGTH}\")
-        if (\${SIZE_OUTPUT_LENGTH} STREQUAL 7)
-            EXTRACT(SIZE_OUTPUT_LINES 3 PROGRAM_SIZE_ROW)
-            EXTRACT(SIZE_OUTPUT_LINES 5 DATA_SIZE_ROW)
-            PARSE(PROGRAM_SIZE_ROW PROGRAM)
-            PARSE(DATA_SIZE_ROW  DATA)
-
-            set(SIZE_STATUS \"Size: \")
-            set(SIZE_STATUS \"\${SIZE_STATUS} [\${PROGRAM_NAME}: \${PROGRAM_SIZE} \${PROGRAM_SIZE_TYPE} (\${PROGRAM_PERCENT}%)] \")
-            set(SIZE_STATUS \"\${SIZE_STATUS} [\${DATA_NAME}: \${DATA_SIZE} \${DATA_SIZE_TYPE} (\${DATA_PERCENT}%)]\")
-            set(SIZE_STATUS \"\${SIZE_STATUS} on \${MCU}\")
-
-            message(\"\${SIZE_STATUS}\\n\")
+        if (\${SIZE_OUTPUT_LENGTH} STREQUAL 14)
+            EXTRACT(SIZE_OUTPUT_LINES 3 FIRMWARE_PROGRAM_SIZE_ROW)
+            EXTRACT(SIZE_OUTPUT_LINES 5 FIRMWARE_DATA_SIZE_ROW)
+            PARSE(FIRMWARE_PROGRAM_SIZE_ROW FIRMWARE_PROGRAM)
+            PARSE(FIRMWARE_DATA_SIZE_ROW  FIRMWARE_DATA)
+
+            set(FIRMWARE_STATUS \"Firmware Size: \")
+            set(FIRMWARE_STATUS \"\${FIRMWARE_STATUS} [\${FIRMWARE_PROGRAM_NAME}: \${FIRMWARE_PROGRAM_SIZE} \${FIRMWARE_PROGRAM_SIZE_TYPE} (\${FIRMWARE_PROGRAM_PERCENT}%)] \")
+            set(FIRMWARE_STATUS \"\${FIRMWARE_STATUS} [\${FIRMWARE_DATA_NAME}: \${FIRMWARE_DATA_SIZE} \${FIRMWARE_DATA_SIZE_TYPE} (\${FIRMWARE_DATA_PERCENT}%)]\")
+            set(FIRMWARE_STATUS \"\${FIRMWARE_STATUS} on \${MCU}\")
+
+            EXTRACT(SIZE_OUTPUT_LINES 10 EEPROM_PROGRAM_SIZE_ROW)
+            EXTRACT(SIZE_OUTPUT_LINES 12 EEPROM_DATA_SIZE_ROW)
+            PARSE(EEPROM_PROGRAM_SIZE_ROW EEPROM_PROGRAM)
+            PARSE(EEPROM_DATA_SIZE_ROW  EEPROM_DATA)
+
+            set(EEPROM_STATUS \"EEPROM   Size: \")
+            set(EEPROM_STATUS \"\${EEPROM_STATUS} [\${EEPROM_PROGRAM_NAME}: \${EEPROM_PROGRAM_SIZE} \${EEPROM_PROGRAM_SIZE_TYPE} (\${EEPROM_PROGRAM_PERCENT}%)] \")
+            set(EEPROM_STATUS \"\${EEPROM_STATUS} [\${EEPROM_DATA_NAME}: \${EEPROM_DATA_SIZE} \${EEPROM_DATA_SIZE_TYPE} (\${EEPROM_DATA_PERCENT}%)]\")
+            set(EEPROM_STATUS \"\${EEPROM_STATUS} on \${MCU}\")
+
+            message(\"\${FIRMWARE_STATUS}\")
+            message(\"\${EEPROM_STATUS}\\n\")

             if(\$ENV{VERBOSE})
                 message(\"\${RAW_SIZE_OUTPUT}\\n\")


build: remove unnecessary `set_target_property`

Now that `_add_swift_host_library_single` only deals with host
libraries, it is no longer mutating the name of the library target.
This `set_target_property` is no longer needed.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -841,11 +841,6 @@

   set_target_properties("${target}" PROPERTIES BUILD_WITH_INSTALL_RPATH YES)
   set_target_properties("${target}" PROPERTIES FOLDER "Swift libraries")
-
-  set_target_properties(${target}
-      PROPERTIES
-      # Library name (without the variant information)
-      OUTPUT_NAME ${target})

   # Handle linking and dependencies.
   add_dependencies_multiple_targets(


CMake: test that we can actually link to the llvm libraries

Mostly to catch issues like #295 - "cannot find -ledit"

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -584,6 +584,61 @@
 set(LLC_HOST_CPU "${LLC_HOST_CPU}" CACHE STRING "The Host CPU to use with llc")

 ####################################################################
+
+# This tests that we can actually link to the llvm libraries.
+# Mostly to catch issues like #295 - cannot find -ledit
+
+setup_cache_var_name(LLVM_LINK_TEST "LLVM_LINK_TEST-${LLVM_HOST_TARGET}-${CLANG}")
+
+if(NOT DEFINED ${CACHE_VAR_NAME})
+
+  set(LLVM_LINK_TEST_SOURCE "
+    #include <stdio.h>
+    #include \"llvm/IR/LLVMContext.h\"
+    #include \"llvm/Support/SourceMgr.h\"
+    #include \"llvm/IR/Module.h\"
+    #include \"llvm/IRReader/IRReader.h\"
+
+    int main( int argc, char* argv[] )
+    {
+       if( argc < 2 )
+         exit(2);
+
+       llvm::LLVMContext &context = llvm::getGlobalContext();
+       llvm::SMDiagnostic err;
+       std::unique_ptr<llvm::Module> module = llvm::parseIRFile( argv[1], err, context );
+
+       if( !module )
+         exit(1);
+       else
+         module->dump();
+
+       return 0;
+    }")
+
+  string(RANDOM RNDNAME)
+  set(LLVM_LINK_TEST_FILENAME "${CMAKE_BINARY_DIR}/llvm_link_test_${RNDNAME}.cc")
+  file(WRITE "${LLVM_LINK_TEST_FILENAME}" "${LLVM_LINK_TEST_SOURCE}")
+
+  try_compile(LLVM_LINK_TEST ${CMAKE_BINARY_DIR} "${LLVM_LINK_TEST_FILENAME}"
+              CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${LLVM_INCLUDE_DIRS}"
+              CMAKE_FLAGS "-DLINK_DIRECTORIES:STRING=${LLVM_LIBDIR}"
+              LINK_LIBRARIES "${LLVM_LDFLAGS} ${LLVM_LIBS} ${LLVM_SYSLIBS}"
+              COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ${LLVM_CXXFLAGS}"
+              OUTPUT_VARIABLE _TRY_COMPILE_OUTPUT)
+
+  if (LLVM_LINK_TEST)
+    message(STATUS "LLVM link test OK")
+  else()
+    message(STATUS "LLVM link test output: ${_TRY_COMPILE_OUTPUT}")
+    message(FATAL_ERROR "LLVM link test FAILED. This mostly happens when your LLVM installation does not have all dependencies installed.")
+  endif()
+
+endif()
+
+set_cache_var(LLVM_LINK_TEST "LLVM link test result")
+
+####################################################################
 #X86 has -march and -mcpu reversed, for clang

 if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "(powerpc|armv7)")


fix link order error

fix link order error

--- cmake/util.cmake
+++ cmake/util.cmake
@@ -155,8 +155,8 @@
 function(link_paddle_test TARGET_NAME)
     link_paddle_exe(${TARGET_NAME})
     target_link_libraries(${TARGET_NAME}
-                          ${GTEST_LIBRARIES}
-                          paddle_test_main)
+                          paddle_test_main
+                          ${GTEST_LIBRARIES})
 endfunction()

 # add_unittest_without_exec


pass disable hdf5 support as chached variable so as to be compliant with other pull request

--- SuperBuild/External_STIR.cmake
+++ SuperBuild/External_STIR.cmake
@@ -96,7 +96,7 @@
     -DSTIR_OPENMP=${STIR_ENABLE_OPENMP}
     # Use 2 variables for ROOT to cover multiple STIR versions
     -DDISABLE_CERN_ROOT_SUPPORT=${STIR_DISABLE_CERN_ROOT} -DDISABLE_CERN_ROOT=${STIR_DISABLE_CERN_ROOT}
-    -DDISABLE_HDF5_SUPPORT=ON
+    -DDISABLE_HDF5_SUPPORT:BOOL=ON
     -DDISABLE_LLN_MATRIX=${STIR_DISABLE_LLN_MATRIX}
     -DSTIR_ENABLE_EXPERIMENTAL=${STIR_ENABLE_EXPERIMENTAL}
    )


Try switching boost versions

Try switching boost versions

--- Superbuild/BoostExternal.cmake
+++ Superbuild/BoostExternal.cmake
@@ -73,7 +73,15 @@
   SET(FORCE_64BIT_BUILD ON)
   SET(boost_GIT_TAG "origin/v1.67.0")
 ELSE()
-  SET(boost_GIT_TAG "origin/v1.58.0")
+
+  if (${USER_PYTHON_VERSION} VERSION_GREATER "3.7")
+    #message(${USER_PYTHON_VERSION} " needs a later boost")
+    SET(boost_GIT_TAG "origin/v1.67.0")
+  else()
+    #message(${USER_PYTHON_VERSION} " ok with old boost")
+    SET(boost_GIT_TAG "origin/v1.58.0")
+  endif()
+
 ENDIF()


--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -19,6 +19,7 @@
 Name[kk]=Лезде хабарласу контакттар тізімі
 Name[km]=ទំនាក់ទំនងការផ្ញើសារបន្ទាន់
 Name[lt]=Greitųjų žinučių kontaktai
+Name[mr]=त्वरित संदेश संपर्क
 Name[nb]=Lynmeldingskontakter
 Name[nl]=Contactpersonen van Instant Messaging
 Name[pl]=Kontakty komunikatorów internetowych
@@ -59,6 +60,7 @@
 Comment[kk]=Кез-келген лезде хабарласу контактыңызбен чат-әңгімені бастау
 Comment[km]=ចាប់ផ្ដើមជជែកជាមួយទំនាក់ទំនងការផ្ញើសារបន្ទាន់របស់អ្នក
 Comment[lt]=Pradėti pokalbį su bet kuriuo TP kontaktu
+Comment[mr]=तुमच्या आयएम संपर्कातील कोणाशीही गप्पा मारा
 Comment[nb]=Start en prat med en av dine LM-kontakter
 Comment[nl]=Begin een chat met een van uw IM-contactpersonen
 Comment[pl]=Rozpocznij rozmowę z kimkolwiek z twoich kontaktów z komunikatora


link to Doxygen project page

link to Doxygen project page

--- fluidsynth/README.cmake
+++ fluidsynth/README.cmake
@@ -71,8 +71,8 @@
 directory different to the source tree. In this case, the "distclean" target
 would be equivalent to simply removing the build directory.

-To compile the developer documentation, use this command from the root build
-directory:
+To compile the developer documentation, install Doxygen (http://www.doxygen.org)
+and use this command from the root build directory:

 $ make doxygen