ctest: refactor test script and shorten Build Name

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

--- test.cmake
+++ test.cmake
@@ -2,27 +2,53 @@
    get_filename_component(CTEST_SOURCE_DIRECTORY "${CMAKE_CURRENT_LIST_FILE}" PATH)
 endif()

+# Dashboard Model
+################################################################################
 set(dashboard_model "$ENV{dashboard_model}")
 if(NOT dashboard_model)
    set(dashboard_model "Experimental")
 endif()
+
+# Set build variables from environment variables
+################################################################################
 set(target_architecture "$ENV{target_architecture}")
 set(skip_tests "$ENV{skip_tests}")

+# Set CMAKE_BUILD_TYPE from environment variable
+################################################################################
 set(build_type "$ENV{build_type}")
 if(NOT build_type)
    set(build_type "Release")
 endif()

 # better make sure we get english output (this is vital for the implicit_type_conversion_failures tests)
+################################################################################
 set(ENV{LANG} "en_US")

+# determine the git branch we're testing
+################################################################################
+file(READ "${CTEST_SOURCE_DIRECTORY}/.git/HEAD" git_branch)
+string(STRIP "${git_branch}" git_branch)
+# -> ref: refs/heads/foobar
+string(REGEX REPLACE "^.*/" "" git_branch "${git_branch}")
+# -> foobar
+
+# determine the (short) hostname of the build machine
+################################################################################
+execute_process(COMMAND hostname -s RESULT_VARIABLE ok OUTPUT_VARIABLE CTEST_SITE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+if(NOT ok EQUAL 0)
+   execute_process(COMMAND hostname OUTPUT_VARIABLE CTEST_SITE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+
+# collect system information for the "Build Name" (and build setup, e.g. -j)
+################################################################################
 find_program(UNAME uname)
 if(UNAME)
    execute_process(COMMAND ${UNAME} -s OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
    string(TOLOWER "${arch}" arch)
    execute_process(COMMAND ${UNAME} -m OUTPUT_VARIABLE chip OUTPUT_STRIP_TRAILING_WHITESPACE)
    string(TOLOWER "${chip}" chip)
+   string(REPLACE "x86_64" "amd64" chip "${chip}")
 else()
    find_program(CMD cmd)
    if(CMD)
@@ -42,7 +68,7 @@
       reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v Identifier
       OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE processorId)
    if("${processorId}" MATCHES "AMD64")
-      set(chip "x86_64")
+      set(chip "amd64")
    elseif("${processorId}" MATCHES "x86")
       set(chip "x86")
    else()
@@ -50,118 +76,156 @@
    endif()
 endif()

-if("${arch}" MATCHES "[Ww]indows" OR "${arch}" MATCHES "win7")
-   find_program(CL cl)
-   execute_process(COMMAND ${CL} /nologo -EP "${CTEST_SOURCE_DIRECTORY}/cmake/msvc_version.c" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
-   string(STRIP "${COMPILER_VERSION}" COMPILER_VERSION)
-   if("${CL}" MATCHES "amd64")
-      set(COMPILER_VERSION "${COMPILER_VERSION} x86 64bit")
-   elseif("${CL}" MATCHES "ia64")
-      set(COMPILER_VERSION "${COMPILER_VERSION} Itanium")
-   else()
-      set(COMPILER_VERSION "${COMPILER_VERSION} x86 32bit")
-   endif()
-   set(number_of_processors "$ENV{NUMBER_OF_PROCESSORS}")
-   if(NOT number_of_processors)
+# determine a short description of the OS we're running on
+################################################################################
+if(arch STREQUAL "linux")
+   execute_process(COMMAND lsb_release -d COMMAND cut -f2 OUTPUT_VARIABLE os_ident)
+   string(REGEX REPLACE "\\(.*\\)" "" os_ident "${os_ident}") # shorten the Distribution string, stripping everything in parens
+   string(REPLACE "Scientific Linux SL" "SL" os_ident "${os_ident}")
+   string(REPLACE " release" "" os_ident "${os_ident}")
+   string(REPLACE " GNU_Linux" "" os_ident "${os_ident}")
+   string(STRIP "${os_ident}" os_ident)
+else()
+   set(os_ident "${arch}")
+endif()
+
+# Determine the processor count (number_of_processors)
+################################################################################
+set(number_of_processors "$ENV{NUMBER_OF_PROCESSORS}")
+if(NOT number_of_processors)
+   if("${arch}" MATCHES "[Ww]indows" OR "${arch}" MATCHES "win7" OR "${arch}" MATCHES "mingw")
       execute_process(COMMAND
          reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor"
          OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
       string(REGEX REPLACE "[^0-9]+" "," number_of_processors "${number_of_processors}")
       string(REGEX REPLACE "^.*," "" number_of_processors "${number_of_processors}")
       math(EXPR number_of_processors "1 + ${number_of_processors}")
-   endif()
-elseif(arch MATCHES "mingw")
-   find_program(CL cl)
-   find_program(GXX "g++")
-   if("$ENV{CXX}" MATCHES "g\\+\\+")
-      set(GXX "$ENV{CXX}")
-   endif()
-   if(GXX)
-      execute_process(COMMAND "${GXX}" --version OUTPUT_VARIABLE COMPILER_VERSION ERROR_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-      string(REPLACE "\n" ";" COMPILER_VERSION "${COMPILER_VERSION}")
-      list(GET COMPILER_VERSION 0 COMPILER_VERSION)
-   elseif(CL)
+   elseif("${arch}" STREQUAL "darwin")
+      execute_process(COMMAND sysctl -n hw.ncpu OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
+   else()
+      execute_process(COMMAND grep -c processor /proc/cpuinfo OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
+   endif()
+endif()
+
+# Determine the compiler version string
+################################################################################
+set(compiler)
+macro(extract_msvc_compiler_info CL)
+   if(CL)
       execute_process(COMMAND ${CL} /nologo -EP "${CTEST_SOURCE_DIRECTORY}/cmake/msvc_version.c" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
       string(STRIP "${COMPILER_VERSION}" COMPILER_VERSION)
+      if("${CL}" MATCHES "amd64")
+         set(COMPILER_VERSION "${COMPILER_VERSION} amd64")
+      elseif("${CL}" MATCHES "ia64")
+         set(COMPILER_VERSION "${COMPILER_VERSION} ia64")
+      else()
+         set(COMPILER_VERSION "${COMPILER_VERSION} x86")
+      endif()
+      set(compiler "MSVC")
    else()
       message(FATAL_ERROR "unknown compiler")
    endif()
-   execute_process(COMMAND reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor" COMMAND grep -c CentralProcessor OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
-else()
-   set(_cxx "$ENV{CXX}")
-   if(NOT _cxx)
-      find_program(GXX "g++")
-      if(GXX)
-         set(_cxx "${GXX}")
-      else()
-         set(_cxx "c++")
-      endif()
-   endif()
-   execute_process(COMMAND ${_cxx} --version OUTPUT_VARIABLE COMPILER_VERSION_COMPLETE ERROR_VARIABLE COMPILER_VERSION_COMPLETE OUTPUT_STRIP_TRAILING_WHITESPACE)
+endmacro()
+macro(extract_gnuc_compiler_info CXX)
+   execute_process(COMMAND "${CXX}" --version OUTPUT_VARIABLE COMPILER_VERSION_COMPLETE ERROR_VARIABLE COMPILER_VERSION_COMPLETE OUTPUT_STRIP_TRAILING_WHITESPACE)
    string(REPLACE "\n" ";" COMPILER_VERSION "${COMPILER_VERSION_COMPLETE}")
    list(GET COMPILER_VERSION 0 COMPILER_VERSION)
    string(REPLACE "Open64 Compiler Suite: Version" "Open64" COMPILER_VERSION "${COMPILER_VERSION}")
-   if(arch STREQUAL "darwin")
-      execute_process(COMMAND sysctl -n hw.ncpu OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
-   else()
-      execute_process(COMMAND grep -c processor /proc/cpuinfo OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
-   endif()
-endif()
-
-file(READ "${CTEST_SOURCE_DIRECTORY}/.git/HEAD" git_branch)
-string(STRIP "${git_branch}" git_branch)
-# -> ref: refs/heads/master
-string(REGEX REPLACE "^.*/" "" git_branch "${git_branch}")
-# -> master
-
-if(arch STREQUAL "linux")
-   execute_process(COMMAND lsb_release -d COMMAND cut -f2 OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE lsbRelease)
-   set(CTEST_BUILD_NAME "${lsbRelease}")
-else()
-   set(CTEST_BUILD_NAME "${arch}")
-endif()
-string(STRIP "${CTEST_BUILD_NAME} ${chip} ${COMPILER_VERSION} $ENV{CXXFLAGS}" CTEST_BUILD_NAME)
-set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME} ${build_type}")
+   string(REPLACE "gxx" "GCC" COMPILER_VERSION "${COMPILER_VERSION}")
+   string(REPLACE "g++" "GCC" COMPILER_VERSION "${COMPILER_VERSION}")
+   string(REPLACE ".exe" "" COMPILER_VERSION "${COMPILER_VERSION}")
+   string(REGEX REPLACE " \\(.*\\)" "" COMPILER_VERSION "${COMPILER_VERSION}")
+   string(REGEX REPLACE " \\[.*\\]" "" COMPILER_VERSION "${COMPILER_VERSION}")
+   string(STRIP "${COMPILER_VERSION}" COMPILER_VERSION)
+   if(COMPILER_VERSION_COMPLETE MATCHES "Free Software Foundation, Inc." AND NOT COMPILER_VERSION MATCHES "GCC")
+      # it's GCC but without "GCC" in the COMPILER_VERSION string - fix it up
+      string(REPLACE "cxx" "GCC" COMPILER_VERSION "${COMPILER_VERSION}")
+      string(REPLACE "c++" "GCC" COMPILER_VERSION "${COMPILER_VERSION}")
+      if(NOT COMPILER_VERSION MATCHES "GCC")
+         set(COMPILER_VERSION "GCC (${COMPILER_VERSION})")
+      endif()
+   endif()
+   if(COMPILER_VERSION MATCHES "clang")
+      set(compiler "clang")
+   elseif(COMPILER_VERSION MATCHES "ICC")
+      set(compiler "ICC")
+   elseif(COMPILER_VERSION MATCHES "Open64")
+      set(compiler "Open64")
+   elseif(COMPILER_VERSION MATCHES "GCC")
+      if(WIN32)
+         set(compiler "MinGW")
+      else()
+         set(compiler "GCC")
+      endif()
+   endif()
+endmacro()
+if("${arch}" MATCHES "[Ww]indows" OR "${arch}" MATCHES "win7")
+   find_program(CL cl)
+   extract_msvc_compiler_info(${CL})
+elseif(arch MATCHES "mingw")
+   if("$ENV{CXX}" MATCHES "g\\+\\+" OR "$ENV{CXX}" MATCHES "gxx")
+      set(GXX "$ENV{CXX}")
+   else()
+      find_program(GXX NAMES "g++" "gxx")
+   endif()
+   if(GXX)
+      extract_gnuc_compiler_info("${GXX}")
+   else()
+      find_program(CL cl)
+      extract_msvc_compiler_info(${CL})
+   endif()
+else()
+   set(CXX "$ENV{CXX}")
+   if(NOT CXX)
+      find_program(CXX "g++" "clang++" "icpc" "c++")
+   endif()
+   extract_gnuc_compiler_info("${CXX}")
+endif()
+
+# Build the CTEST_BUILD_NAME string
+################################################################################
 if(target_architecture)
-   set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME} ${target_architecture}")
-else()
-   execute_process(COMMAND cmake -Darch=${arch} -P ${CTEST_SOURCE_DIRECTORY}/print_target_architecture.cmake OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE auto_target_arch ERROR_VARIABLE auto_target_arch)
-   set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME} ${auto_target_arch}")
-endif()
-string(REPLACE "/" "_" CTEST_BUILD_NAME "${git_branch}: ${CTEST_BUILD_NAME}")
-string(REPLACE "+" "x" CTEST_BUILD_NAME "${CTEST_BUILD_NAME}") # CDash fails to escape '+' correctly in URIs
-string(REGEX REPLACE "[][ ():]" "_" CTEST_BINARY_DIRECTORY "${CTEST_BUILD_NAME}")
+   set(tmp ${target_architecture})
+else()
+   execute_process(COMMAND cmake -Darch=${arch} -P ${CTEST_SOURCE_DIRECTORY}/print_target_architecture.cmake OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE tmp ERROR_VARIABLE tmp)
+endif()
+if(build_type STREQUAL "Release")
+   set(build_type_short "Rel")
+elseif(build_type STREQUAL "Debug")
+   set(build_type_short "Deb")
+elseif(build_type STREQUAL "RelWithDebInfo")
+   set(build_type_short "RDI")
+elseif(build_type STREQUAL "RelWithDebug")
+   set(build_type_short "RWD")
+elseif(build_type STREQUAL "None")
+   set(build_type_short "Non")
+else()
+   set(build_type_short "${build_type}")
+endif()
+string(STRIP "${git_branch} ${COMPILER_VERSION} $ENV{CXXFLAGS} ${build_type_short} ${tmp} ${chip} ${os_ident}" CTEST_BUILD_NAME)
+string(REPLACE "  " " " CTEST_BUILD_NAME "${CTEST_BUILD_NAME}")
+
+# work around CDash limitations:
+string(REPLACE "/" "_" CTEST_BUILD_NAME "${CTEST_BUILD_NAME}")
+string(REPLACE "+" "x" CTEST_BUILD_NAME "${CTEST_BUILD_NAME}")
+
+# Determine build directory
+################################################################################
+string(REGEX REPLACE "[][ ():,]" "" CTEST_BINARY_DIRECTORY "${CTEST_BUILD_NAME}")
 set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build-${dashboard_model}-${CTEST_BINARY_DIRECTORY}")
 file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")

-execute_process(COMMAND hostname -s RESULT_VARIABLE ok OUTPUT_VARIABLE CTEST_SITE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-if(NOT ok EQUAL 0)
-   execute_process(COMMAND hostname OUTPUT_VARIABLE CTEST_SITE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif()
+# Give user feedback
+################################################################################
+#message("src:        ${CTEST_SOURCE_DIRECTORY}")
+#message("obj:        ${CTEST_BINARY_DIRECTORY}")
+message("build name: ${CTEST_BUILD_NAME}")
+message("site:       ${CTEST_SITE}")
+message("model:      ${dashboard_model}")

 Set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY_ONCE TRUE)

 set(CTEST_NOTES_FILES "${CTEST_SOURCE_DIRECTORY}/.git/HEAD" "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}")
-
-set(compiler)
-if(COMPILER_VERSION MATCHES "clang")
-   set(compiler "clang")
-elseif(COMPILER_VERSION MATCHES "MSVC")
-   set(compiler "MSVC")
-elseif(COMPILER_VERSION MATCHES "ICC")
-   set(compiler "ICC")
-elseif(COMPILER_VERSION MATCHES "Open64")
-   set(compiler "Open64")
-elseif(COMPILER_VERSION MATCHES "g\\+\\+" OR COMPILER_VERSION_COMPLETE MATCHES "Free Software Foundation, Inc.")
-   if(WIN32)
-      set(compiler "MinGW")
-   else()
-      set(compiler "GCC")
-   endif()
-endif()
-if(COMPILER_VERSION MATCHES "\\((experimental|prerelease)\\)" OR COMPILER_VERSION_COMPLETE MATCHES "clang.git")
-   set(compiler "experimental")
-endif()

 include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
 ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
@@ -173,14 +237,6 @@
 else()
    set(MAKE_ARGS "-j${number_of_processors} -k")
 endif()
-
-message("********************************")
-#message("src:        ${CTEST_SOURCE_DIRECTORY}")
-#message("obj:        ${CTEST_BINARY_DIRECTORY}")
-message("build name: ${CTEST_BUILD_NAME}")
-message("site:       ${CTEST_SITE}")
-message("model:      ${dashboard_model}")
-message("********************************")

 if(WIN32)
    if("${compiler}" STREQUAL "MSVC")


FindFFMPEG.cmake defines FFMPEG_INCLUDE_DIRS

--- FindFFMPEG.cmake
+++ FindFFMPEG.cmake
@@ -121,8 +121,9 @@
   IF(FFMPEG_avformat_LIBRARY)
     IF(FFMPEG_avcodec_LIBRARY)
       IF(FFMPEG_avutil_LIBRARY)
-        SET( FFMPEG_FOUND "YES" )
-        SET( FFMPEG_BASIC_LIBRARIES
+        SET(FFMPEG_FOUND TRUE)
+        SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIR})
+        SET(FFMPEG_BASIC_LIBRARIES
           ${FFMPEG_avcodec_LIBRARY}
           ${FFMPEG_avformat_LIBRARY}
           ${FFMPEG_avutil_LIBRARY}


Separate compiler warnings for C and C++

Avoids compiler whining about C++ warning options when compiling C files.

--- build_settings.cmake
+++ build_settings.cmake
@@ -17,15 +17,19 @@
 set(AUTORUN_UNIT_TESTS FALSE CACHE BOOL "If TRUE, tests will be run immediately after linking the test executable")

 # Warnings
-set(WARN_OPTS "-Wsuggest-override -Winline -Wuninitialized -Werror -Wall -W -Wchar-subscripts -Wcomment -Wformat -Wparentheses -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings")
+set(C_WARN_OPTS "-Winline -Wuninitialized -Werror -Wall -W -Wchar-subscripts -Wcomment -Wformat -Wparentheses -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings")
+
+# Warnings that are specific to C++ compilation
+# Note: this is not a union of C_WARN_OPTS, since CMAKE_CXX_FLAGS already includes CMAKE_C_FLAGS, which in turn includes C_WARN_OPTS transitively
+set(CXX_SPECIFIC_WARN_OPTS "-Wsuggest-override -Wnon-virtual-dtor")

 # C and C++ compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel ${EXTRA_C_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -std=c++1z -Wnon-virtual-dtor -fvisibility-inlines-hidden -fdiagnostics-color=auto ${EXTRA_CXX_FLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 ${C_WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel ${EXTRA_C_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} ${CXX_SPECIFIC_WARN_OPTS} -std=c++1z -fvisibility-inlines-hidden -fdiagnostics-color=auto ${EXTRA_CXX_FLAGS}")

 # Linker flags
 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id -latomic -ldl -Wl,-E")
-SET( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -rdynamic" )
+SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -rdynamic" )

 # Use C++ 17
 #TODO renable when cmake 3.8 is out.


Split off 7.10.22

Split off 7.10.22

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

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


Split off 7.8.68

Split off 7.8.68

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

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


package.json.cmake: remove repository tag causing issues on update

Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- src/javascript/package.json.cmake
+++ src/javascript/package.json.cmake
@@ -3,12 +3,6 @@
   "description": "IO library that helps you use I2c, SPI, gpio, uart, pwm, analog inputs (aio) and more on a number of platforms such as the Intel galileo, the Intel edison and others",
   "keywords":["gpio", "edison","galileo","io", "mraajs", "spi", "i2c", "minnow", "intel"],
   "homepage": "http://github.com/intel-iot-devkit/mraa",
-
-
-  "repository" : {
-    "type" : "git",
-    "url" : "http://github.com/intel-iot-devkit/mraa.git"
-  },
   "main" : "./mraa.node",
   "engines": {
     "node": ">= 1.0.x"


Adding new documentation file to the list of files to be installed

--- Resources/CMake/MXAInstall.cmake
+++ Resources/CMake/MXAInstall.cmake
@@ -62,6 +62,7 @@
   ${MXA_DOCUMENTATION_DIR}/ImportingData.html
   ${MXA_DOCUMENTATION_DIR}/index.html
   ${MXA_DOCUMENTATION_DIR}/MXAUtilities.html
+  ${MXA_DOCUMENTATION_DIR}/MXASpecification.html
   ${MXA_DOCUMENTATION_DIR}/Navigation.js
   ${MXA_DOCUMENTATION_DIR}/site.css
   ${MXA_DOCUMENTATION_DIR}/SystemRequirements.html


Develop (#56)

Develop (#56)

* meaningless change to force CI

* [fixed] to INCLUDE_DIRECTORIES before TRIBITS_ADD_LIBRARY

--- cmake/BOTG.cmake
+++ cmake/BOTG.cmake
@@ -194,6 +194,12 @@

     IF( enabled )

+        #set include directories
+        TRIBITS_INCLUDE_DIRECTORIES(
+            ${CMAKE_CURRENT_SOURCE_DIR}  #For C++
+            ${CMAKE_CURRENT_BINARY_DIR}  #For fortran modules/configured files
+        )
+
         #create list of sources
         SET( sources )
         FOREACH( source ${library_SOURCES} )
@@ -222,6 +228,8 @@
         TRIBITS_ADD_LIBRARY( ${name}
             SOURCES
                 "${sources}"
+            HEADERS
+                "${headers}"
             NOINSTALLHEADERS
                 "${headers}"
         )
@@ -231,11 +239,6 @@
             TARGET_LINK_LIBRARIES( ${name} ${link_to} )
         ENDFOREACH()

-        #set include directories
-        INCLUDE_DIRECTORIES(
-            ${CMAKE_CURRENT_SOURCE_DIR}  #For C++
-            ${CMAKE_CURRENT_BINARY_DIR}  #For fortran modules/configured files
-        )

     ENDIF()


upgrade to SDL 2.10.4 in cmake builds too

--- cmake/SDL2.cmake
+++ cmake/SDL2.cmake
@@ -1,10 +1,10 @@
-set(LibSDL2_Spec_URL "http://www.libsdl.org/release/SDL2-2.0.7.tar.gz")
-set(LibSDL2_Spec_ArchiveName SDL2-2.0.7.tar.gz)
-set(LibSDL2_Spec_ArchiveHash "SHA256=ee35c74c4313e2eda104b14b1b86f7db84a04eeab9430d56e001cea268bf4d5e")
+set(LibSDL2_Spec_URL "http://www.libsdl.org/release/SDL2-2.0.14.tar.gz")
+set(LibSDL2_Spec_ArchiveName SDL2-2.0.14.tar.gz)
+set(LibSDL2_Spec_ArchiveHash "SHA256=d8215b571a581be1332d2106f8036fcb03d12a70bae01e20f424976d275432bc")

 set(LibSDL2_Spec_MacLibraries libSDL2-2.0.0.dylib)
 set(LibSDL2_Spec_MacLibrariesSymlinks libSDL2*.dylib)
-set(LibSDL2_Spec_LinuxLibraries libSDL2-2.0.so.0.7.0)
+set(LibSDL2_Spec_LinuxLibraries libSDL2-2.0.so.0.14.0)
 set(LibSDL2_Spec_LinuxLibrariesSymlinks libSDL2*so*)
 set(LibSDL2_Spec_WindowsLibraries libSDL2.dll.a)
 set(LibSDL2_Spec_WindowsDLLs SDL2.dll)


Removed tools from compilation.

Removed tools from compilation.

We want to handle this with libraries in the future.

--- cmake/bgfx.cmake
+++ cmake/bgfx.cmake
@@ -34,10 +34,10 @@
 # Configure platform-specific build commands.
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 14 2015")
     set(bgfx_COMPILER "vs2015")
-    set(bgfx_CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E env "BX_DIR=${bx_DIR}" "${bx_GENIE}${CMAKE_EXECUTABLE_SUFFIX}" --with-tools --with-shared-lib "${bgfx_COMPILER}")
+    set(bgfx_CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E env "BX_DIR=${bx_DIR}" "${bx_GENIE}${CMAKE_EXECUTABLE_SUFFIX}" --with-shared-lib "${bgfx_COMPILER}")
     set(bgfx_BUILD_COMMAND "devenv" "<SOURCE_DIR>/.build/projects/${bgfx_COMPILER}/bgfx.sln" /Build Release|x64)
 elseif("${CMAKE_GENERATOR}" STREQUAL "Unix Makefiles")
-    set(bgfx_CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E env "BX_DIR=${bx_DIR}" "${bx_GENIE}${CMAKE_EXECUTABLE_SUFFIX}" --with-tools --with-shared-lib "--gcc=${bgfx_GENIE_GCC}" gmake)
+    set(bgfx_CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E env "BX_DIR=${bx_DIR}" "${bx_GENIE}${CMAKE_EXECUTABLE_SUFFIX}" --with-shared-lib "--gcc=${bgfx_GENIE_GCC}" gmake)
     set(bgfx_BUILD_COMMAND "$(MAKE)" -C "<SOURCE_DIR>/.build/projects/gmake-${bgfx_SYSTEM_NAME}" config=release64)
 else()
     message(FATAL_ERROR "BGFX does not support the generator '${CMAKE_GENERATOR}'.")


CMake warning to recommend ISPC v1.8.1 with KNC.

--- cmake/ispc.cmake
+++ cmake/ispc.cmake
@@ -15,6 +15,12 @@
 ## ======================================================================== ##

 SET(ISPC_VERSION_REQUIRED "1.8.2")
+
+# warn about recommended ISPC version on KNC
+IF (OSPRAY_MIC AND NOT OSPRAY_WARNED_MIC_ISPC_VERSION)
+  MESSAGE("Warning: use of ISPC v1.8.1 is recommended on KNC.")
+  SET(OSPRAY_WARNED_MIC_ISPC_VERSION ON CACHE INTERNAL "Warned about recommended ISPC version with KNC.")
+ENDIF()

 IF (NOT ISPC_EXECUTABLE)
   # try sibling folder as hint for path of ISPC


Update register_kernels and kernel_library function in pten.cmake (#39259)

--- cmake/pten.cmake
+++ cmake/pten.cmake
@@ -93,7 +93,7 @@
     set(all_srcs)
     set(kernel_deps)

-    set(oneValueArgs "")
+    set(oneValueArgs SUB_DIR)
     set(multiValueArgs SRCS DEPS)
     cmake_parse_arguments(kernel_library "${options}" "${oneValueArgs}"
         "${multiValueArgs}" ${ARGN})
@@ -135,8 +135,17 @@
     foreach(src ${all_srcs})
         file(READ ${src} target_content)
         string(REGEX MATCHALL "#include \"paddle\/pten\/kernels\/[a-z0-9_]+_kernel.h\"" include_kernels ${target_content})
+        if ("${kernel_library_SUB_DIR}" STREQUAL "")
+            string(REGEX MATCHALL "#include \"paddle\/pten\/kernels\/[a-z0-9_]+_kernel.h\"" include_kernels ${target_content})
+        else()
+            string(REGEX MATCHALL "#include \"paddle\/pten\/kernels\/${kernel_library_SUB_DIR}\/[a-z0-9_]+_kernel.h\"" include_kernels ${target_content})
+        endif()
         foreach(include_kernel ${include_kernels})
+        if ("${kernel_library_SUB_DIR}" STREQUAL "")
             string(REGEX REPLACE "#include \"paddle\/pten\/kernels\/" "" kernel_name ${include_kernel})
+        else()
+            string(REGEX REPLACE "#include \"paddle\/pten\/kernels\/${kernel_library_SUB_DIR}\/" "" kernel_name ${include_kernel})
+        endif()
             string(REGEX REPLACE ".h\"" "" kernel_name ${kernel_name})
             list(APPEND kernel_deps ${kernel_name})
         endforeach()
@@ -250,7 +259,7 @@

 function(register_kernels)
     set(options "")
-    set(oneValueArgs "")
+    set(oneValueArgs SUB_DIR)
     set(multiValueArgs EXCLUDES DEPS)
     cmake_parse_arguments(register_kernels "${options}" "${oneValueArgs}"
         "${multiValueArgs}" ${ARGN})
@@ -263,9 +272,9 @@
         list(FIND register_kernels_EXCLUDES ${target} _index)
         if (${_index} EQUAL -1)
             if (${register_kernels_DEPS_len} GREATER 0)
-                kernel_library(${target} DEPS ${register_kernels_DEPS})
+                kernel_library(${target} DEPS ${register_kernels_DEPS} SUB_DIR ${register_kernels_SUB_DIR})
             else()
-                kernel_library(${target})
+                kernel_library(${target} SUB_DIR ${register_kernels_SUB_DIR})
             endif()
         endif()
     endforeach()


cmake: convert WEST_PYTHON path to be correct CMake style

The `WEST_PYTHON` reported by west (python) may use a different path
style (casing and separator) than the path style in CMake
find_package(Python3).

This may result in following additional error text when west version is
not meeting the minimum required version:

    The Python version used by west is:  c:\python37\python.exe
    The Python version used by CMake is: C:/Python37/python.exe
    This might be correct, but please verify your installation.

Using `get_filename_component` will return the path in same style as
CMake find_package(Python3).

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

--- cmake/west.cmake
+++ cmake/west.cmake
@@ -21,11 +21,12 @@
     )

   if(WEST_PYTHON)
+    get_filename_component(WEST_PYTHON ${WEST_PYTHON} ABSOLUTE)
     if(NOT (${WEST_PYTHON} STREQUAL ${PYTHON_EXECUTABLE}))
       set(PYTHON_EXECUTABLE_OUT_OF_SYNC "\nNote:\n\
   The Python version used by west is:  ${WEST_PYTHON}\n\
   The Python version used by CMake is: ${PYTHON_EXECUTABLE}\n\
-  This might be correct, but please verify your installation.\n")
+  This might be correct, but please verify your installation.")
     endif()
   endif()

@@ -43,7 +44,7 @@
   But the minimum supported version is ${MIN_WEST_VERSION}\n\
   Please upgrade with:\n\
       ${PYTHON_EXECUTABLE} -m pip install --upgrade west\
-  ${PYTHON_EXECUTABLE_OUT_OF_SYNC}")
+  ${PYTHON_EXECUTABLE_OUT_OF_SYNC}\n")
   endif()

   # Just output information for a single version. This will still work


Added specific flags for GCC

Added specific flags for GCC

--- RageCommon.cmake
+++ RageCommon.cmake
@@ -50,7 +50,7 @@
 	# Managing Build Types
 	# default build type
 	IF(NOT CMAKE_BUILD_TYPE)
-	  SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
+	  SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None Debug Release." FORCE)
 	ENDIF(NOT CMAKE_BUILD_TYPE)

 	IF (CMAKE_BUILD_TYPE STREQUAL Debug)
@@ -144,6 +144,23 @@
 	#SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
 	#MODULE and SHARED also ??
 ENDIF(MSVC)
+IF(CMAKE_COMPILER_IS_GNUCXX)
+	MESSAGE( STATUS "GCC Compiler detected. Adjusting C++ flags...")
+	SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wabi" CACHE STRING
+	    "Flags used by the C++ compiler during debug builds."
+	    FORCE )
+	SET( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -pedantic" CACHE STRING
+	    "Flags used by the C compiler during debug builds."
+	    FORCE )
+	SET( CMAKE_EXE_LINKER_FLAGS_DEBUG
+	    "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
+	    "Flags used for linking binaries during debug builds."
+	    FORCE )
+	SET( CMAKE_SHARED_LINKER_FLAGS_DEBUG
+	    "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
+	    "Flags used by the shared libraries linker during debug builds."
+	    FORCE )
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)


cmake: Remove unneeded BUILD_LIBRARIES option

Building the shape library is required to build most of the CLIs

--- SPHARM-PDM.cmake
+++ SPHARM-PDM.cmake
@@ -23,11 +23,7 @@
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)

-option(BUILD_LIBRARIES "Build libraries" ON)
-mark_as_advanced(BUILD_LIBRARIES)
-if(BUILD_LIBRARIES)
-  add_subdirectory(Libraries)
-endif()
+add_subdirectory(Libraries)

 #-----------------------------------------------------------------------------
 # Testing


ENH: Add OpenIGTLink library to SuperBuild

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -127,3 +127,18 @@
   DEPENDS
     "GenerateCLP"
 )
+
+set(proj OpenIGTLink)
+
+ExternalProject_Add(${proj}
+  SVN_REPOSITORY "http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink"
+  CMAKE_GENERATOR ${gen}
+  CMAKE_ARGS
+    -DCMAKE_INSTALL_PREFIX:PATH=${prefix}/OpenIGTLink
+    -DCMAKE_BUILD_TYPE:STRING=${build_type}
+    -DBUILD_EXAMPLES:BOOL=OFF
+    -DBUILD_SHARED_LIBS:BOOL=${shared}
+    -DBUILD_TESTING:BOOL=OFF
+)
+
+


BUG: Fixed TubeTK_USE_FANN to work with SuperBuild.

TubeTK_USE_FANN was not being properly passed from the top level to the
TubeTK-Build directory. This caused TubeTK_USE_FANN to always be false when
superbuilding.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -255,6 +255,7 @@
     -DTubeTK_USE_OpenIGTLink:BOOL=${TubeTK_USE_OpenIGTLink}
     -DOpenIGTLink_DIR:PATH=${OpenIGTLink_DIR}
     -DTubeTK_USE_CTK:BOOL=${TubeTK_USE_CTK}
+    -DTubeTK_USE_FANN:BOOL=${TubeTK_USE_FANN}
     -DCTK_DIR:PATH=${CTK_DIR}
   INSTALL_COMMAND ""
   DEPENDS


Only require minimum dependencies.

Only require minimum dependencies.

--- Plugins/my.awesomeproject.exampleapp/manifest_headers.cmake
+++ Plugins/my.awesomeproject.exampleapp/manifest_headers.cmake
@@ -2,4 +2,4 @@
 set(Plugin-Version "0.1")
 set(Plugin-Vendor "Awesome Company")
 set(Plugin-ContactAddress "http://www.awesomeproject.my")
-set(Require-Plugin org.mitk.core.ext org.mitk.gui.qt.common org.mitk.gui.qt.datamanager org.mitk.gui.qt.ext)
+set(Require-Plugin org.mitk.gui.qt.ext)


cmake: fix ps2toolchain

cmake: fix ps2toolchain

--- cmake/ps2/cmaketoolchain/toolchain_ps2_ee.cmake
+++ cmake/ps2/cmaketoolchain/toolchain_ps2_ee.cmake
@@ -3,10 +3,8 @@
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")

 set(CMAKE_SYSTEM_NAME "PlayStation2")
-set(CMAKE_SYSTEM_PROCESSOR "mipsel")
+set(CMAKE_SYSTEM_PROCESSOR "mips64r5900el")
 set(CMAKE_SYSTEM_VERSION 1)
-
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)

 set(CMAKE_NO_SYSTEM_FROM_IMPORTED ON)

@@ -18,37 +16,47 @@
 if(NOT DEFINED ENV{PS2SDK})
     message(FATAL_ERROR "Need environment variable PS2SDK set")
 endif()
+if(NOT DEFINED ENV{GSKIT})
+    message(FATAL_ERROR "Need environment variable PS2SDK set")
+endif()
+
 set(PS2DEV "$ENV{PS2DEV}")
 set(PS2SDK "$ENV{PS2SDK}")
+set(GSKIT "$ENV{GSKIT}")

 if(NOT IS_DIRECTORY "${PS2DEV}")
-    message(FATAL_ERROR "PS2DEV must contain a folder path (${PS2DEV})")
+    message(FATAL_ERROR "PS2DEV must be a folder path (${PS2DEV})")
 endif()

 if(NOT IS_DIRECTORY "${PS2SDK}")
-    message(FATAL_ERROR "PS2SDK must contain a folder path (${PS2SDK})")
+    message(FATAL_ERROR "PS2SDK must be a folder path (${PS2SDK})")
+endif()
+
+if(NOT IS_DIRECTORY "${GSKIT}")
+    message(FATAL_ERROR "GSKIT must be a folder path (${GSKIT})")
 endif()

 set(CMAKE_DSM_SOURCE_FILE_EXTENSIONS "dsm")

-set(CMAKE_C_COMPILER "${PS2DEV}/ee/bin/ee-gcc")
-set(CMAKE_CXX_COMPILER "${PS2DEV}/ee/bin/ee-g++")
-set(CMAKE_ASM_COMPILER "${PS2DEV}/ee/bin/ee-g++")
-set(CMAKE_DSM_COMPILER "${PS2DEV}/dvp/bin/dvp-as")
-set(CMAKE_AR "${PS2DEV}/ee/bin/ee-ar" CACHE FILEPATH "archiver")
-set(CMAKE_LINKER "${PS2DEV}/ee/bin/ee-ld")
-set(CMAKE_RANLIB "${PS2DEV}/ee/bin/ee-ranlib" CACHE FILEPATH "ranlib")
-set(CMAKE_STRIP "${PS2DEV}/ee/bin/ee-strip" CACHE FILEPATH "strip")
+set(CMAKE_C_COMPILER "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-gcc" CACHE FILEPATH "C compiler")
+set(CMAKE_CXX_COMPILER "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-g++" CACHE FILEPATH "CXX compiler")
+set(CMAKE_ASM_COMPILER "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-g++" CACHE FILEPATH "ASM assembler")
+set(CMAKE_DSM_COMPILER "${PS2DEV}/dvp/bin/dvp-as" CACHE FILEPATH "DSM assembler")
+set(CMAKE_AR "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-ar" CACHE FILEPATH "archiver")
+set(CMAKE_LINKER "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-ld" CACHE FILEPATH "Linker")
+set(CMAKE_RANLIB "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-ranlib" CACHE FILEPATH "ranlib")
+set(CMAKE_STRIP "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-strip" CACHE FILEPATH "strip")

-set(CMAKE_ASM_FLAGS_INIT "-G0 -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\"")
-set(CMAKE_C_FLAGS_INIT "-G0 -fno-common -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\"")
-set(CMAKE_CXX_FLAGS_INIT "-G0 -fno-common -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\"")
+set(CMAKE_ASM_FLAGS_INIT "-G0 -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\" -D_EE")
+set(CMAKE_C_FLAGS_INIT "-G0 -fno-common -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\" -D_EE")
+set(CMAKE_CXX_FLAGS_INIT "-G0 -fno-common -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\" -D_EE")
 set(CMAKE_EXE_LINKER_FLAGS_INIT "-G0 -L\"${PS2SDK}/ee/lib\" -Wl,-r -Wl,-d")

-set(CMAKE_FIND_ROOT_PATH "${PS2DEV}/ee" "${PS2SDK}/ee")
+set(CMAKE_FIND_ROOT_PATH "${PS2DEV}/ee" "${PS2SDK}/ee" "${GSKIT}")
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

 set(PS2 1)
 set(EE 1)
@@ -58,7 +66,10 @@
 function(add_erl_executable TARGET)
     cmake_parse_arguments("AEE" "" "OUTPUT_VAR" "" ${ARGN})

-    get_target_property(output_dir ${TARGET} RUNTIME_OUTPUT_DIRECTORY)
+    get_target_property(output_dir "${TARGET}" RUNTIME_OUTPUT_DIRECTORY)
+    if(NOT output_dir)
+        set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
+    endif()

     get_target_property(output_name ${TARGET} OUTPUT_NAME)
     if(NOT output_name)
@@ -67,7 +78,7 @@
     set(outfile "${output_dir}/${output_name}.erl")

     add_custom_command(OUTPUT "${outfile}"
-        COMMAND "${CMAKE_COMMAND}" -E copy  "$<TARGET_FILE:${TARGET}>" "${outfile}"
+        COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:${TARGET}>" "${outfile}"
         COMMAND "${CMAKE_STRIP}" --strip-unneeded -R .mdebug.eabi64 -R .reginfo -R .comment "${outfile}"
         DEPENDS ${TARGET}
     )


Rename git revision variable

Rename git revision variable

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

-IF(CMAKE_VERSION VERSION_LESS 2.8)
-  MESSAGE(STATUS "No revision version support, git not found")
+if(CMAKE_VERSION VERSION_LESS 2.8)
+  message(STATUS "No revision version support, git not found")
   return()
-ENDIF()
+endif()

-IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
-  FIND_PACKAGE(Git)
-  IF(GIT_FOUND)
-    EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
+  find_package(Git)
+  if(GIT_FOUND)
+    execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-      OUTPUT_VARIABLE EQ_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
-    MESSAGE(STATUS "git revision ${EQ_REVISION}")
-  ELSE()
-    MESSAGE(STATUS "No revision version support, git not found")
-  ENDIF()
-ENDIF()
+      OUTPUT_VARIABLE GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
+    MESSAGE(STATUS "git revision ${GIT_REVISION}")
+  else()
+    message(STATUS "No revision version support, git not found")
+  endif()
+endif()


COMP: Update to version for WikiExamples

The wikiexamples were upgraded to allow both
forward and backwards compatibility with ITK 4.8.0.

Change-Id: I92032a5254978ddee560cb1959345f7f116138f8

--- Modules/Remote/WikiExamples.remote.cmake
+++ Modules/Remote/WikiExamples.remote.cmake
@@ -5,6 +5,6 @@
 itk_fetch_module(WikiExamples
   "A collection of examples that illustrate how to use ITK."
   GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKWikiExamples.git
-  # June 26, 2015
-  GIT_TAG 74e09f3e88cf2168e35af197e4b27a8686aa8f22
+  # July 09, 2015
+  GIT_TAG 1c53a9346e914959f1afb8df79cf449ff99ac7fa
   )


fix  conan install  command in accordance with 1.0.0b2

--- conan.cmake
+++ conan.cmake
@@ -205,11 +205,13 @@
     endif()
     set(CONAN_OPTIONS "")
     if(ARGUMENTS_CONANFILE)
-      set(CONANFILE -f=${CMAKE_CURRENT_SOURCE_DIR}/${ARGUMENTS_CONANFILE})
+      set(CONANFILE ${CMAKE_CURRENT_SOURCE_DIR}/${ARGUMENTS_CONANFILE})
       # A conan file has been specified - apply specified options as well if provided
       foreach(ARG ${ARGUMENTS_OPTIONS})
           set(CONAN_OPTIONS ${CONAN_OPTIONS} -o ${ARG})
       endforeach()
+    else()
+      set(CONANFILE ".")
     endif()
     if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND ARGUMENTS_DEBUG_PROFILE)
       set(settings -pr ${ARGUMENTS_DEBUG_PROFILE})
@@ -253,7 +255,7 @@
 function(conan_cmake_generate_conanfile)
   # Generate, writing in disk a conanfile.txt with the requires, options, and imports
   # specified as arguments
-  # This will be considered as temporary file, generated in CMAKE_CURRENT_BINARY_DIR
+  # This will be considered as temporary file, generated in CMAKE_CURRENT_BINARY_DIR)
   parse_arguments(${ARGV})
   set(_FN "${CMAKE_CURRENT_BINARY_DIR}/conanfile.txt")


COMP: Use single line for string argument, by-pass multi-line issues

This addresses the following CMake configuration error:
CMake Error at Modules/ThirdParty/GoogleTest/itk-module-init.cmake:1
(option):
  Syntax error in cmake code at

    /home/kitware/Dashboards/src/ITK/Modules/ThirdParty/GoogleTest/itk-module-init.cmake:1

  when parsing string

    Use an outside build or install \

  source of GoogleTest.  Set GTEST_ROOT to specify location.

  syntax error, unexpected cal_SYMBOL, expecting $end (91)

Change-Id: I6d2d61d4ed2a3a12b166a4dd3a9531ddf8bc2066

--- Modules/ThirdParty/GoogleTest/itk-module-init.cmake
+++ Modules/ThirdParty/GoogleTest/itk-module-init.cmake
@@ -1,3 +1,2 @@
-option(ITK_USE_SYSTEM_GOOGLETEST "Use an outside build or install \
-source of GoogleTest. Set GTEST_ROOT to specify location." ${ITK_USE_SYSTEM_LIBRARIES})
+option(ITK_USE_SYSTEM_GOOGLETEST "Use an outside build or installed source of GoogleTest. Set GTEST_ROOT to specify location." ${ITK_USE_SYSTEM_LIBRARIES})
 mark_as_advanced(ITK_USE_SYSTEM_GOOGLETEST)


rename files

rename files

--- cmake/FileList.cmake
+++ cmake/FileList.cmake
@@ -120,7 +120,7 @@
 src/util/ftalleg.cpp
 src/util/funcs.cpp
 src/util/file-system.cpp
-src/util/gradient-glow.cpp
+src/util/gradient.cpp
 src/util/ebox.cpp
 src/util/joystick.cpp
 src/util/allegro-joystick.cpp


Added minimal support for linking with freeglut instead of glut.

--- cmake/FindGLUT.cmake
+++ cmake/FindGLUT.cmake
@@ -70,7 +70,7 @@
           ${GLUT_LOCATION}/include
           /usr/include
         )
-        find_library( GLUT_glut_LIBRARY glut32
+        find_library( GLUT_glut_LIBRARY glut32 freeglut
           ${GLUT_LOCATION}/lib
           ${OPENGL_LIBRARY_DIR}
           /usr/lib
@@ -86,7 +86,7 @@
             ${OPENGL_INCLUDE_DIR}
             DOC "The directory where GL/glut.h resides")
         find_library( GLUT_glut_LIBRARY
-            NAMES glut32 glut32s glut
+            NAMES glut32 glut32s glut freeglut
             PATHS
             ${GLUT_LOCATION}/lib
             ${PROJECT_SOURCE_DIR}/extern/glut/bin


Corrected propagation of Root libraries to AliRoot

--- cmake/FindROOT.cmake
+++ cmake/FindROOT.cmake
@@ -29,7 +29,7 @@
   ALICE_RootConfig(ROOTCLIBS --glibs)
   ALICE_RootConfig(ROOTHASALIEN --has-alien)
   ALICE_RootConfig(ROOTHASXML --has-xml)
-  set(ROOTCLIBS ${ROOTCLIBS} -lThread -lMinuit -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lXMLParser -lProof -lProofPlayer -lMLP -lSpectrum -L${ROOTPLUGDIR} )
+  set(ROOTCLIBS "${ROOTCLIBS} -lThread -lMinuit -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lXMLParser -lProof -lProofPlayer -lMLP -lSpectrum -L${ROOTPLUGDIR}" )
   set(ROOTPLIBS $ENV{ROOTPLIBS})
   message(STATUS "ROOTSYS directory : ${ROOTSYS}")
   message(STATUS "ROOT include directory: ${ROOTINCDIR}")


Revert "fixed path with spaces in llvm-config (#2854)"

This reverts commit d23798a296ddab023009dab860b6cb9361a62abd.

This caused build problems for several people.

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -5,15 +5,15 @@
 # LLVM_FOUND
 # LLVM_INCLUDE_DIRS
 # LLVM_LIBRARIES
-# LLVM_LIBDIR
+# LLVM_LIBDIRS

 find_program(LLVM_CONFIG_EXE
-  NAMES llvm-config-8 llvm-config-8.0 llvm-config80 llvm-config
-  PATHS
-    "/mingw64/bin"
-    "/c/msys64/mingw64/bin"
-    "c:/msys64/mingw64/bin"
-    "C:/Libraries/llvm-8.0.0/bin")
+    NAMES llvm-config-8 llvm-config-8.0 llvm-config80 llvm-config
+    PATHS
+        "/mingw64/bin"
+        "/c/msys64/mingw64/bin"
+        "c:/msys64/mingw64/bin"
+        "C:/Libraries/llvm-8.0.0/bin")

 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
   message(FATAL_ERROR "unable to find llvm-config")
@@ -24,9 +24,9 @@
 endif()

 execute_process(
-  COMMAND ${LLVM_CONFIG_EXE} --version
-  OUTPUT_VARIABLE LLVM_CONFIG_VERSION
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
+	COMMAND ${LLVM_CONFIG_EXE} --version
+	OUTPUT_VARIABLE LLVM_CONFIG_VERSION
+	OUTPUT_STRIP_TRAILING_WHITESPACE)

 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 8)
   message(FATAL_ERROR "expected LLVM 8.x but found ${LLVM_CONFIG_VERSION}")
@@ -39,15 +39,15 @@
 endif()

 execute_process(
-  COMMAND ${LLVM_CONFIG_EXE} --targets-built
-  OUTPUT_VARIABLE LLVM_TARGETS_BUILT_SPACES
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}")
+	COMMAND ${LLVM_CONFIG_EXE} --targets-built
+    OUTPUT_VARIABLE LLVM_TARGETS_BUILT_SPACES
+	OUTPUT_STRIP_TRAILING_WHITESPACE)
+string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}")
 function(NEED_TARGET TARGET_NAME)
-  list (FIND LLVM_TARGETS_BUILT "${TARGET_NAME}" _index)
-  if (${_index} EQUAL -1)
-    message(FATAL_ERROR "LLVM is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
-  endif()
+    list (FIND LLVM_TARGETS_BUILT "${TARGET_NAME}" _index)
+    if (${_index} EQUAL -1)
+        message(FATAL_ERROR "LLVM is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
+    endif()
 endfunction(NEED_TARGET)
 NEED_TARGET("AArch64")
 NEED_TARGET("AMDGPU")
@@ -67,53 +67,47 @@

 if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC)
   execute_process(
-    COMMAND ${LLVM_CONFIG_EXE} --libdir --link-static
-    OUTPUT_VARIABLE LLVM_LIBDIR_ORIG
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-  file(TO_CMAKE_PATH "${LLVM_LIBDIR_ORIG}" LLVM_LIBDIR)
+      COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static
+      OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}")

   execute_process(
-    COMMAND ${LLVM_CONFIG_EXE} --libnames --link-static
-    OUTPUT_VARIABLE LLVM_LIBNAMES_SPACES
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REPLACE " " ";" LLVM_LIBNAMES "${LLVM_LIBNAMES_SPACES}")
-  foreach(LLVM_LIBNAME ${LLVM_LIBNAMES})
-    list(APPEND LLVM_LIBRARIES "${LLVM_LIBDIR}/${LLVM_LIBNAME}")
-  endforeach()
+      COMMAND ${LLVM_CONFIG_EXE} --system-libs --link-static
+      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")

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

   execute_process(
-    COMMAND ${LLVM_CONFIG_EXE} --libs
-    OUTPUT_VARIABLE LLVM_LIBNAMES_SPACES
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-    string(REPLACE " " ";" LLVM_LIBNAMES "${LLVM_LIBNAMES_SPACES}")
-  foreach(LLVM_LIBNAME ${LLVM_LIBNAMES})
-    list(APPEND LLVM_LIBRARIES "${LLVM_LIBDIR}/${LLVM_LIBNAME}")
-  endforeach()
+      COMMAND ${LLVM_CONFIG_EXE} --system-libs
+      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")

   execute_process(
-    COMMAND ${LLVM_CONFIG_EXE} --system-libs
-    OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-    string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")
+      COMMAND ${LLVM_CONFIG_EXE} --libdir
+      OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}")
 endif()

 execute_process(
-  COMMAND ${LLVM_CONFIG_EXE} --includedir
-  OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
+    COMMAND ${LLVM_CONFIG_EXE} --includedir
+    OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
+    OUTPUT_STRIP_TRAILING_WHITESPACE)

 set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})

@@ -122,9 +116,9 @@
 endif()

 link_directories("${CMAKE_PREFIX_PATH}/lib")
-link_directories("${LLVM_LIBDIR}")
+link_directories("${LLVM_LIBDIRS}")

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(LLVM DEFAULT_MSG LLVM_LIBRARIES LLVM_INCLUDE_DIRS)

-mark_as_advanced(LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_LIBDIR)
+mark_as_advanced(LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_LIBDIRS)


dont compile, if none of the given flags work: compile if NO_FLAG is given

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -336,7 +336,12 @@
 # helper macro for vc_compile_for_all_implementations
 macro(_vc_compile_one_implementation _objs _impl)
    set(_extra_flags)
+   set(_ok FALSE)
    foreach(_flag ${ARGN})
+      if(_flag STREQUAL "NO_FLAG")
+         set(_ok TRUE)
+         break()
+      endif()
       AddCompilerFlag(${_flag} CXX_RESULT _ok)
       if(_ok)
          set(_extra_flags ${_flag})
@@ -344,20 +349,22 @@
       endif()
    endforeach()

-   get_filename_component(_out "${_vc_compile_src}" NAME_WE)
-   get_filename_component(_ext "${_vc_compile_src}" EXT)
-   set(_out "${_out}_${_impl}${_ext}.o")
-   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_out}
-      COMMAND ${CMAKE_CXX_COMPILER} ${_flags} ${_extra_flags}
-      -DVC_IMPL=${_impl}
-      -c -o ${_out} ${CMAKE_CURRENT_SOURCE_DIR}/${_vc_compile_src}
-      MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${_vc_compile_src}
-      IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/${_vc_compile_src}
-      COMMENT "Building CXX object ${_out}"
-      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
-      VERBATIM
-      )
-   list(APPEND ${_objs} "${CMAKE_CURRENT_BINARY_DIR}/${_out}")
+   if(_ok)
+      get_filename_component(_out "${_vc_compile_src}" NAME_WE)
+      get_filename_component(_ext "${_vc_compile_src}" EXT)
+      set(_out "${_out}_${_impl}${_ext}.o")
+      add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_out}
+         COMMAND ${CMAKE_CXX_COMPILER} ${_flags} ${_extra_flags}
+         -DVC_IMPL=${_impl}
+         -c -o ${_out} ${CMAKE_CURRENT_SOURCE_DIR}/${_vc_compile_src}
+         MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${_vc_compile_src}
+         IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/${_vc_compile_src}
+         COMMENT "Building CXX object ${_out}"
+         WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+         VERBATIM
+         )
+      list(APPEND ${_objs} "${CMAKE_CURRENT_BINARY_DIR}/${_out}")
+   endif()
 endmacro()

 # Generate compile rules for the given C++ source file for all available implementations and return
@@ -386,7 +393,7 @@

    set(_vc_compile_src "${_src}")

-   _vc_compile_one_implementation(${_objs} Scalar)
+   _vc_compile_one_implementation(${_objs} Scalar NO_FLAG)
    if(NOT Vc_SSE_INTRINSICS_BROKEN)
       _vc_compile_one_implementation(${_objs} SSE2   "-msse2"   "-xSSE2"   "/arch:SSE2")
       _vc_compile_one_implementation(${_objs} SSE3   "-msse3"   "-xSSE3"   "/arch:SSE2")


fptu: fix GCC's LTO-toolset finding.

fptu: fix GCC's LTO-toolset finding.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -169,22 +169,13 @@

     get_filename_component(gcc_dir ${CMAKE_C_COMPILER} DIRECTORY)
     if(NOT CMAKE_GCC_AR)
-      find_program(CMAKE_GCC_AR NAMES gcc${gcc_suffix}-ar)
-      if(NOT CMAKE_GCC_AR AND NOT gcc_dir STREQUAL "/usr/bin")
-        find_program(CMAKE_GCC_AR NAMES gcc-ar PATHS ${gcc_dir} NO_DEFAULT_PATH)
-      endif()
+      find_program(CMAKE_GCC_AR NAMES gcc${gcc_suffix}-ar PATHS ${gcc_dir} NO_DEFAULT_PATH)
     endif()
     if(NOT CMAKE_GCC_NM)
-      find_program(CMAKE_GCC_NM NAMES gcc${gcc_suffix}-nm)
-      if(NOT CMAKE_GCC_NM AND NOT gcc_dir STREQUAL "/usr/bin")
-        find_program(CMAKE_GCC_NM NAMES gcc-nm PATHS ${gcc_dir} NO_DEFAULT_PATH)
-      endif()
+      find_program(CMAKE_GCC_NM NAMES gcc${gcc_suffix}-nm PATHS ${gcc_dir} NO_DEFAULT_PATH)
     endif()
     if(NOT CMAKE_GCC_RANLIB)
-      find_program(CMAKE_GCC_RANLIB NAMES gcc${gcc_suffix}-ranlib)
-      if(NOT CMAKE_GCC_RANLIB AND NOT gcc_dir STREQUAL "/usr/bin")
-        find_program(CMAKE_GCC_RANLIB NAMES gcc-ranlib PATHS ${gcc_dir} NO_DEFAULT_PATH)
-      endif()
+      find_program(CMAKE_GCC_RANLIB NAMES gcc${gcc_suffix}-ranlib PATHS ${gcc_dir} NO_DEFAULT_PATH)
     endif()

     unset(gcc_dir)
@@ -197,6 +188,7 @@
   endif()

   if(CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB AND gcc_lto_wrapper)
+    message(STATUS "Found GCC's LTO toolset: ${gcc_lto_wrapper}, ${CMAKE_GCC_AR}, ${CMAKE_GCC_RANLIB}")
     set(GCC_LTO_CFLAGS "-flto -fno-fat-lto-objects -fuse-linker-plugin")
     set(GCC_LTO_AVAILABLE TRUE)
     message(STATUS "Link-Time Optimization by GCC is available")


Fix CFLAGS setup in Debug mode

Fix CFLAGS setup in Debug mode

We were passing -g flag twice, just uncool.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -80,10 +80,9 @@
 #
 # Perform build type specific configuration.
 #
-if (CMAKE_COMPILER_IS_GNUCC)
+check_c_compiler_flag("-ggdb" CC_HAS_GGDB)
+if (CC_HAS_GGDB)
     set (CC_DEBUG_OPT "-ggdb")
-else()
-    set (CC_DEBUG_OPT "-g")
 endif()

 set (CMAKE_C_FLAGS_DEBUG


added AppKit as framework to Apple Compiler

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -9,6 +9,7 @@

     if(APPLE)
         set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
+        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AppKit")
     endif()
 else()
     message(WARNING "unknown compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}")


Update SDL2 to version 2.0.6

Update SDL2 to version 2.0.6

--- cmake/get-sdl2.cmake
+++ cmake/get-sdl2.cmake
@@ -5,7 +5,7 @@

 include(ExternalProject)

-set(SDL2_VERSION "2.0.5")
+set(SDL2_VERSION "2.0.6")

 # For Windows it's faster to download the pre-compiled development binaries.
 if (WIN32)
@@ -17,7 +17,7 @@
       PREFIX ${DEPENDENCY_EXTRACT_DIR}
       DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
       URL http://libsdl.org/release/SDL2-devel-${SDL2_VERSION}-mingw.tar.gz
-      URL_MD5 ecf8fb614d57e7d284086a36dae6878f
+      URL_MD5 742fcd6b03307f46bda2a1075151d328
       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""
       INSTALL_COMMAND
@@ -34,7 +34,7 @@
       PREFIX ${DEPENDENCY_EXTRACT_DIR}
       DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
       URL http://libsdl.org/release/SDL2-devel-${SDL2_VERSION}-VC.zip
-      URL_MD5 b771f36bb640c173e53fa8259cdd3835
+      URL_MD5 b5d9ba2c24e21addbc6c84adfbd1b340
       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""
       INSTALL_COMMAND
@@ -59,7 +59,7 @@
     PREFIX ${DEPENDENCY_EXTRACT_DIR}
     DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
     URL http://libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz
-    URL_MD5 d4055424d556b4a908aa76fad63abd3c
+    URL_MD5 4c2d602766b48b8f1b19a6f903ef5ecf
     #CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${DEPENDENCY_INSTALL_DIR}
     INSTALL_DIR ${DEPENDENCY_INSTALL_DIR}
     CMAKE_ARGS ${SDL2_CMAKE_ARGS}


fptu-cmake: add LIBCXX_FILESYSTEM.

fptu-cmake: add LIBCXX_FILESYSTEM.

--- cmake.fptu/compiler.cmake
+++ cmake.fptu/compiler.cmake
@@ -572,3 +572,17 @@
       HAVE_FFSLL)
   endif()
 endif()
+
+# determine library for for std::filesystem
+set(LIBCXX_FILESYSTEM "")
+if(CMAKE_COMPILER_IS_GNUCXX)
+  if (CMAKE_CXX_COMPILER_VERSION LESS 9.0)
+    set(LIBCXX_FILESYSTEM "stdc++fs")
+  endif()
+elseif (CMAKE_COMPILER_IS_CLANG)
+  if (CMAKE_CXX_COMPILER_VERSION LESS 5.0)
+    set(LIBCXX_FILESYSTEM "c++experimental")
+  else()
+    set(LIBCXX_FILESYSTEM "stdc++fs")
+  endif()
+endif()


package the CAPI inference library and third_party (#21299)

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -55,8 +55,81 @@
     endforeach ()
 endfunction()

+function(copy_part_of_thrid_party TARGET DST)
+    if(${CBLAS_PROVIDER} STREQUAL MKLML)
+        set(dst_dir "${DST}/third_party/install/mklml")
+        if(WIN32)
+            copy(${TARGET}
+                    SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_SHARED_LIB}
+                    ${MKLML_SHARED_LIB_DEPS} ${MKLML_SHARED_IOMP_LIB} ${MKLML_INC_DIR}
+                    DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir}/lib
+                    ${dst_dir}/lib ${dst_dir}/lib ${dst_dir})
+        else()
+            copy(${TARGET}
+                    SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR}
+                    DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir})
+        endif()
+    elseif(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
+        set(dst_dir "${DST}/third_party/install/openblas")
+            copy(${TARGET}
+                    SRCS ${CBLAS_INSTALL_DIR}/lib ${CBLAS_INSTALL_DIR}/include
+                    DSTS ${dst_dir} ${dst_dir})
+    endif()
+
+    if(WITH_MKLDNN)
+        set(dst_dir "${DST}/third_party/install/mkldnn")
+        if(WIN32)
+            copy(${TARGET}
+                    SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB} ${MKLDNN_LIB}
+                    DSTS ${dst_dir} ${dst_dir}/lib ${dst_dir}/lib)
+        else()
+            copy(${TARGET}
+                    SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB}
+                    DSTS ${dst_dir} ${dst_dir}/lib)
+        endif()
+    endif()
+
+    set(dst_dir "${DST}/third_party/install/gflags")
+    copy(${TARGET}
+            SRCS ${GFLAGS_INCLUDE_DIR} ${GFLAGS_LIBRARIES}
+            DSTS ${dst_dir} ${dst_dir}/lib)
+
+    set(dst_dir "${DST}/third_party/install/glog")
+    copy(${TARGET}
+            SRCS ${GLOG_INCLUDE_DIR} ${GLOG_LIBRARIES}
+            DSTS ${dst_dir} ${dst_dir}/lib)
+
+    if (NOT PROTOBUF_FOUND OR WIN32)
+        set(dst_dir "${DST}/third_party/install/protobuf")
+        copy(${TARGET}
+                SRCS ${PROTOBUF_INCLUDE_DIR} ${PROTOBUF_LIBRARY}
+                DSTS ${dst_dir} ${dst_dir}/lib)
+    endif ()
+
+    if (WITH_NGRAPH)
+        set(dst_dir "${DST}/third_party/install/ngraph")
+        copy(${TARGET}
+                SRCS ${NGRAPH_INC_DIR} ${NGRAPH_LIB_DIR}
+                DSTS ${dst_dir} ${dst_dir})
+    endif ()
+
+    if (TENSORRT_FOUND)
+        set(dst_dir "${DST}/third_party/install/tensorrt")
+        copy(${TARGET}
+                SRCS ${TENSORRT_INCLUDE_DIR}/Nv*.h ${TENSORRT_LIBRARY_DIR}/*nvinfer*
+                DSTS ${dst_dir}/include ${dst_dir}/lib)
+    endif ()
+
+    if (ANAKIN_FOUND)
+        set(dst_dir "${DST}/third_party/install/anakin")
+        copy(${TARGET}
+                SRCS ${ANAKIN_ROOT}/*
+                DSTS ${dst_dir})
+    endif ()
+endfunction()
+
 # inference library for only inference
-set(inference_lib_deps third_party paddle_fluid paddle_fluid_shared)
+set(inference_lib_deps third_party paddle_fluid paddle_fluid_shared paddle_fluid_c paddle_fluid_c_shared)
 add_custom_target(inference_lib_dist DEPENDS ${inference_lib_deps})

 set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/eigen3")
@@ -74,50 +147,6 @@
         SRCS ${DLPACK_INCLUDE_DIR}/dlpack
         DSTS ${dst_dir})

-
-if(${CBLAS_PROVIDER} STREQUAL MKLML)
-    set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/mklml")
-    if(WIN32)
-        copy(inference_lib_dist
-                SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_SHARED_LIB}
-                  ${MKLML_SHARED_LIB_DEPS} ${MKLML_SHARED_IOMP_LIB} ${MKLML_INC_DIR}
-                DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir}/lib
-                  ${dst_dir}/lib ${dst_dir}/lib ${dst_dir})
-    else()
-        copy(inference_lib_dist
-                SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR}
-                DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir})
-    endif()
-elseif(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
-    set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/openblas")
-        copy(inference_lib_dist
-                SRCS ${CBLAS_INSTALL_DIR}/lib ${CBLAS_INSTALL_DIR}/include
-                DSTS ${dst_dir} ${dst_dir})
-endif()
-
-if(WITH_MKLDNN)
-    set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/mkldnn")
-    if(WIN32)
-        copy(inference_lib_dist
-                SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB} ${MKLDNN_LIB}
-                DSTS ${dst_dir} ${dst_dir}/lib ${dst_dir}/lib)
-    else()
-        copy(inference_lib_dist
-                SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB}
-                DSTS ${dst_dir} ${dst_dir}/lib)
-    endif()
-endif()
-
-set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/gflags")
-copy(inference_lib_dist
-        SRCS ${GFLAGS_INCLUDE_DIR} ${GFLAGS_LIBRARIES}
-        DSTS ${dst_dir} ${dst_dir}/lib)
-
-set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/glog")
-copy(inference_lib_dist
-        SRCS ${GLOG_INCLUDE_DIR} ${GLOG_LIBRARIES}
-        DSTS ${dst_dir} ${dst_dir}/lib)
-
 set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/xxhash")
 copy(inference_lib_dist
         SRCS ${XXHASH_INCLUDE_DIR} ${XXHASH_LIBRARIES}
@@ -128,37 +157,11 @@
         SRCS ${ZLIB_INCLUDE_DIR} ${ZLIB_LIBRARIES}
         DSTS ${dst_dir} ${dst_dir}/lib)

-if (NOT PROTOBUF_FOUND OR WIN32)
-    set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/protobuf")
-    copy(inference_lib_dist
-            SRCS ${PROTOBUF_INCLUDE_DIR} ${PROTOBUF_LIBRARY}
-            DSTS ${dst_dir} ${dst_dir}/lib)
-endif ()
-
-if (WITH_NGRAPH)
-    set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/ngraph")
-    copy(inference_lib_dist
-            SRCS ${NGRAPH_INC_DIR} ${NGRAPH_LIB_DIR}
-            DSTS ${dst_dir} ${dst_dir})
-endif ()
-
-if (TENSORRT_FOUND)
-    set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/tensorrt")
-    copy(inference_lib_dist
-            SRCS ${TENSORRT_INCLUDE_DIR}/Nv*.h ${TENSORRT_LIBRARY_DIR}/*nvinfer*
-            DSTS ${dst_dir}/include ${dst_dir}/lib)
-endif ()
-
-if (ANAKIN_FOUND)
-    set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/anakin")
-    copy(inference_lib_dist
-            SRCS ${ANAKIN_ROOT}/*
-            DSTS ${dst_dir})
-endif ()
-
 copy(inference_lib_dist
         SRCS ${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt
         DSTS ${FLUID_INFERENCE_INSTALL_DIR})
+
+copy_part_of_thrid_party(inference_lib_dist ${FLUID_INFERENCE_INSTALL_DIR})

 set(src_dir "${PADDLE_SOURCE_DIR}/paddle/fluid")
 if(WIN32)
@@ -171,6 +174,30 @@
         SRCS  ${src_dir}/inference/api/paddle_*.h ${paddle_fluid_lib}
         DSTS  ${FLUID_INFERENCE_INSTALL_DIR}/paddle/include ${FLUID_INFERENCE_INSTALL_DIR}/paddle/lib)

+
+# CAPI inference library for only inference
+set(FLUID_INFERENCE_C_INSTALL_DIR "${CMAKE_BINARY_DIR}/fluid_inference_c_install_dir" CACHE STRING
+"A path setting CAPI fluid inference shared")
+copy_part_of_thrid_party(inference_lib_dist ${FLUID_INFERENCE_C_INSTALL_DIR})
+
+set(src_dir "${PADDLE_SOURCE_DIR}/paddle/fluid")
+if(WIN32)
+    set(paddle_fluid_c_lib ${PADDLE_BINARY_DIR}/paddle/fluid/inference/capi/${CMAKE_BUILD_TYPE}/paddle_fluid_c.dll
+        ${PADDLE_BINARY_DIR}/paddle/fluid/inference/capi/${CMAKE_BUILD_TYPE}/paddle_fluid_c.lib)
+else(WIN32)
+    set(paddle_fluid_c_lib ${PADDLE_BINARY_DIR}/paddle/fluid/inference/libpaddle_fluid.*)
+endif(WIN32)
+
+if(WIN32)
+    copy(inference_lib_dist
+            SRCS  ${src_dir}/inference/capi/c_api.h ${paddle_fluid_c_lib}
+            DSTS  ${FLUID_INFERENCE_C_INSTALL_DIR}/paddle/include ${FLUID_INFERENCE_C_INSTALL_DIR}/paddle/lib
+                  ${FLUID_INFERENCE_C_INSTALL_DIR}/paddle/lib)
+else()
+    copy(inference_lib_dist
+        SRCS  ${src_dir}/inference/capi/c_api.h ${paddle_fluid_c_lib}
+        DSTS  ${FLUID_INFERENCE_C_INSTALL_DIR}/paddle/include ${FLUID_INFERENCE_C_INSTALL_DIR}/paddle/lib)
+endif()

 # fluid library for both train and inference
 set(fluid_lib_deps inference_lib_dist)
@@ -254,3 +281,4 @@
 endfunction()
 version(${FLUID_INSTALL_DIR}/version.txt)
 version(${FLUID_INFERENCE_INSTALL_DIR}/version.txt)
+version(${FLUID_INFERENCE_C_INSTALL_DIR}/version.txt)


ENABLE_pyqt4 defaults to OFF.

ENABLE_pyqt4 defaults to OFF.

svn path=/trunk/; revision=10046

--- cmake/modules/pyqt4.cmake
+++ cmake/modules/pyqt4.cmake
@@ -22,17 +22,13 @@
 if(DEFAULT_NO_BINDINGS)
   option(ENABLE_pyqt4 "Enable PyQt4 bindings" OFF)
 else(DEFAULT_NO_BINDINGS)
-  option(ENABLE_pyqt4 "Enable PyQt4 bindings" ON)
+  option(ENABLE_pyqt4 "Enable PyQt4 bindings" OFF)
 endif(DEFAULT_NO_BINDINGS)

 if(NOT ENABLE_python AND NOT PLD_extqt)
   set(ENABLE_pyqt4 OFF CACHE BOOL "Enable PyQt4 bindings" FORCE)
 endif(NOT ENABLE_python AND NOT PLD_extqt)

-set(ENABLE_pyqt4 OFF CACHE BOOL "Enable PyQt4 bindings" FORCE)
-
 if(ENABLE_pyqt4)
   message(STATUS "Checking for PyQt4")
 endif(ENABLE_pyqt4)
-
-


add cmake log if tests will be build

add cmake log if tests will be build

--- cmake/qibuild/flags.cmake
+++ cmake/qibuild/flags.cmake
@@ -118,6 +118,10 @@
   _qi_add_flags(CMAKE_CXX_FLAGS ${hardening_flags})
 endif()

+if(QI_WITH_TESTS)
+  qi_info("Enabling tests build")
+endif()
+
 if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
   if(NOT QI_WITH_DEBUG_INFO)
     # This makes it possible to remove warnings about missing .pdb


fix(tools): link against the atomic library with older clang versions

--- cmake/CMakeCompiler.cmake
+++ cmake/CMakeCompiler.cmake
@@ -67,5 +67,10 @@
 		else()
 			target_compile_options(${_project_name} PRIVATE -g)					# Enable debug symbols
 		endif()
+
+		# Link against the atomic library with x86 clang 4 and 5
+		if(CPU_INSTRUCTION_SET MATCHES "x86" AND CLANG_VERSION_MAJOR VERSION_LESS 5)
+			target_link_libraries(${_project_name} PRIVATE "-latomic")
+		endif()
 	endif()
 endmacro()


CMake check for Google Mock bugfix

CMake check for Google Mock bugfix

-looks in /usr/src/gmock or ChordAlg/dependencies/gmock-1.7.0
-reports error if not found

--- cmake/Modules/gmock.cmake
+++ cmake/Modules/gmock.cmake
@@ -15,12 +15,14 @@
 # GMock
 ################################
 # ${CMAKE_SOURCE_DIR}/dependencies/gmock-1.7.0
-if(EXISTS "usr/src/gmock")
+if(EXISTS /usr/src/gmock/)
     set(GMOCK_DIR "/usr/src/gmock"
         CACHE PATH "The path to the GoogleMock test framework.")
-else()
+elseif(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/gmock-1.7.0)
     set(GMOCK_DIR "${CMAKE_SOURCE_DIR}/dependencies/gmock-1.7.0"
         CACHE PATH "The path to the GoogleMock test framework")
+else()
+    message(FATAL_ERROR "GoogleMock not found, expected in /usr/src/gmock or ${CMAKE_SOURCE_DIR}/dependencies/gmock-1.7.0")
 endif()
 add_subdirectory(${GMOCK_DIR} ${CMAKE_BINARY_DIR}/gmock)
 set_property(TARGET gtest APPEND_STRING PROPERTY COMPILE_FLAGS " -w")


[CMAKE] Use native strip on OSX

[CMAKE] Use native strip on OSX

Summary:
This will allow for running the install/strip target when cross building
for OSX.

Test Plan:
  mkdir buildcmake && cd buildcmake
  mkdir install
  cmake -GNinja .. DCMAKE_INSTALL_PREFIX=install \
    -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/OSX.cmake
  ninja install/strip
Check the executables are stripped (compare the size vs non stripped).

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D4378

--- cmake/platforms/OSX.cmake
+++ cmake/platforms/OSX.cmake
@@ -35,7 +35,8 @@
 string(APPEND CMAKE_C_FLAGS_INIT ${OSX_EXTRA_FLAGS})
 string(APPEND CMAKE_CXX_FLAGS_INIT ${OSX_EXTRA_FLAGS} " -stdlib=libc++")

-# Ensure we use an OSX specific version of ar, ranlib and nm.
+# Ensure we use an OSX specific version of ar, ranlib, nm and strip.
 find_program(CMAKE_AR ${TOOLCHAIN_PREFIX}-ar)
 find_program(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}-ranlib)
 find_program(CMAKE_NM ${TOOLCHAIN_PREFIX}-nm)
+find_program(CMAKE_STRIP ${TOOLCHAIN_PREFIX}-strip)


config.cmake: fix widget entry point

config.cmake: fix widget entry point

Change-Id: I5a0c1fd2ac97c0643273e25d2cbb1d761b2af5d5
Signed-off-by: Stephane Desneux <94d5c471d7125b04aaf7f10fd5b446f8b0fa7a5f@iot.bzh>

--- conf.d/cmake/config.cmake
+++ conf.d/cmake/config.cmake
@@ -100,10 +100,10 @@
 # at launch time by the application framework
 #
 # !IMPORTANT! : Service Widget Mimetype has to specified
-# the WIDGET_ENTRY_POINT "lib" which is the default directory
-# that holds the bindings.
+# the WIDGET_ENTRY_POINT can then be any file
+# "config.xml" is a good choice as always present and constant
 #
-set(WIDGET_ENTRY_POINT lib)
+set(WIDGET_ENTRY_POINT config.xml)

 # Optional dependencies order
 # ---------------------------


Increase the ament_cppcheck timeout to 5 minutes. (#271)

This will avoid timeouts on some slower platforms that we've
started to see.

Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@openrobotics.org>

--- ament_cmake_cppcheck/cmake/ament_cppcheck.cmake
+++ ament_cmake_cppcheck/cmake/ament_cppcheck.cmake
@@ -61,7 +61,7 @@
   ament_add_test(
     "${ARG_TESTNAME}"
     COMMAND ${cmd}
-    TIMEOUT 180
+    TIMEOUT 300
     OUTPUT_FILE "${CMAKE_BINARY_DIR}/ament_cppcheck/${ARG_TESTNAME}.txt"
     RESULT_FILE "${result_file}"
     WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"


improved FindFreeImage.cmake

improved FindFreeImage.cmake

--- cmake/FindFreeImage.cmake
+++ cmake/FindFreeImage.cmake
@@ -7,21 +7,29 @@
 # Note that the expected include convention is
 #  #include <FreeImage.h>

+SET(FREEIMAGE_FOUND FALSE)
+SET(FREEIMAGE_INCLUDE_DIRS)
+SET(FREEIMAGE_LIBRARIES)
+
 find_path(FREEIMAGE_INCLUDE_DIR FreeImage.h
   HINTS
     ENV FREEIMAGE_DIR
-  PATH_SUFFIXES include/FreeImage include
+  PATH_SUFFIXES include/FreeImage include local/include local/include/FreeImage
   PATHS
   ~/Library/Frameworks
   /Library/Frameworks
   /sw # Fink
-  /opt/local # DarwinPorts
   /opt/csw # Blastwave
   /opt
+  /usr
+  ${CMAKE_LIBRARY_PATH}
 )
+IF(FREEIMAGE_INCLUDE_DIR)
+	SET(FREEIMAGE_INCLUDE_DIRS ${FREEIMAGE_INCLUDE_DIR})
+ENDIF()

 find_library(FREEIMAGE_LIBRARY
-  NAMES FreeImage
+  NAMES freeimage
   HINTS
     ENV FREEIMAGE_DIR
   PATH_SUFFIXES lib
@@ -32,11 +40,26 @@
   /opt/local
   /opt/csw
   /opt
+  /usr
+  ${CMAKE_LIBRARY_PATH}
 )
+IF(FREEIMAGE_LIBRARY)
+	SET(FREEIMAGE_LIBRARIES ${FREEIMAGE_LIBRARY})
+ENDIF()

-find_package(PackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(FreeImage
-                                  REQUIRED_VARS FREEIMAGE_LIBRARY FREEIMAGE_INCLUDE_DIR)
+IF (FREEIMAGE_DIR AND FREEIMAGE_LIBRARY)
+	SET(FREEIMAGE_FOUND TRUE)
+ENDIF()

-mark_as_advanced(FREEIMAGE_INCLUDE_DIR FREEIMAGE_LIBRARY)
+IF (FREEIMAGE_FOUND)
+	IF (NOT FREEIMAGE_FIND_QUIETLY)
+		MESSAGE(STATUS "  Found FreeImage : ${FREEIMAGE_LIBRARIES}")
+	ENDIF (NOT FREEIMAGE_FIND_QUIETLY)
+ELSE (FREEIMAGE_FOUND)
+	IF (FREEIMAGE_FIND_REQUIRED)
+		MESSAGE(FATAL_ERROR "Could not find FreeImage")
+	ENDIF (FREEIMAGE_FIND_REQUIRED)
+ENDIF (FREEIMAGE_FOUND)

+mark_as_advanced(FREEIMAGE_INCLUDE_DIR FREEIMAGE_LIBRARY FREEIMAGE_INCLUDE_DIRS FREEIMAGE_LIBRARIES)
+


Find Oculus SDK version in CMake module.

--- cmake/FindOculusSDK.cmake
+++ cmake/FindOculusSDK.cmake
@@ -4,6 +4,7 @@
 #  OCULUS_SDK_INCLUDE_DIRS - where to find OVR.h, etc.
 #  OCULUS_SDK_LIBRARIES    - List of libraries when using OculusSDK.
 #  OCULUS_SDK_FOUND        - True if OculusSDK found.
+#  OCULUS_SDK_VERSION      - Version of the OculusSDK if found

 IF (DEFINED ENV{OCULUS_SDK_ROOT_DIR})
     SET(OCULUS_SDK_ROOT_DIR "$ENV{OCULUS_SDK_ROOT_DIR}")
@@ -59,6 +60,22 @@
 ENDIF()
 MARK_AS_ADVANCED(OCULUS_MSVC_DIR)

+# Try to ascertain the version of the SDK
+IF(OCULUS_SDK_INCLUDE_DIRS)
+	SET(_OCULUS_VERSION_FILE "${OCULUS_SDK_INCLUDE_DIRS}/OVR_Version.h")
+
+	IF(EXISTS "${_OCULUS_VERSION_FILE}")
+		FILE(STRINGS "${_OCULUS_VERSION_FILE}" _OCULUS_VERSION_FILE_CONTENTS REGEX "#define OVR_[A-Z]+_VERSION[ \t]+[0-9]+")
+
+		STRING(REGEX REPLACE ".*#define OVR_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" OCULUS_SDK_VERSION_MAJOR ${_OCULUS_VERSION_FILE_CONTENTS})
+		STRING(REGEX REPLACE ".*#define OVR_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" OCULUS_SDK_VERSION_MINOR ${_OCULUS_VERSION_FILE_CONTENTS})
+		STRING(REGEX REPLACE ".*#define OVR_BUILD_VERSION[ \t]+([0-9]+).*" "\\1" OCULUS_SDK_VERSION_BUILD ${_OCULUS_VERSION_FILE_CONTENTS})
+
+		SET(OCULUS_SDK_VERSION "${OCULUS_SDK_VERSION_MAJOR}.${OCULUS_SDK_VERSION_MINOR}.${OCULUS_SDK_VERSION_BUILD}" CACHE INTERNAL "The version of Oculus SDK which was detected")
+	ENDIF()
+ENDIF()
+
+
 # Look for the library.
 FIND_LIBRARY(OCULUS_SDK_LIBRARY NAMES libovr libovr64 ovr HINTS ${OCULUS_SDK_ROOT_DIR}
                                                       ${OCULUS_SDK_ROOT_DIR}/LibOVR/Lib/${OCULUS_SDK_LIB_ARCH}/${OCULUS_MSVC_DIR}


I don't understand cmake syntax...

I don't understand cmake syntax...

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -20,7 +20,8 @@

 # Ogg Vorbis
 find_package(OggVorbis REQUIRED)
-if (not VORBISENC_LIBRARY)
+if (VORBISENC_LIBRARY)
+else()
 	set(VORBISENC_LIBRARY "")
 endif()


Small addition for a future OSX installation config

Update #159

--- cmake/InstallConfig.cmake
+++ cmake/InstallConfig.cmake
@@ -33,6 +33,10 @@

     message(STATUS "==============================================================")
     message(STATUS "Installation directories for Windows: ")
+
+elseif(CMAKE_SYSTEM_NAME MATCHES Darwin)
+
+    # add here configuration for OSX

 endif()


another try to get the LICENSE into place

--- cmake/InstallMacros.cmake
+++ cmake/InstallMacros.cmake
@@ -76,7 +76,8 @@
   endif ()

   install(
-    CODE "configure_file(${PROJECT_SOURCE_DIR}/${input} \"${PROJECT_BINARY_DIR}/${output}\" NEWLINE_STYLE ${CRLFSTYLE})"
+    CODE "configure_file(${PROJECT_SOURCE_DIR}/${input} \"${PROJECT_BINARY_DIR}/${output}\" NEWLINE_STYLE ${CRLFSTYLE})")
+  install(
     FILES "${PROJECT_BINARY_DIR}/${output}"
     DESTINATION "${where}"
     )


Fixed compilation with IPP on Linux. Added linking with Intel compiler runtime libraries.

--- cmake/OpenCVFindIPP.cmake
+++ cmake/OpenCVFindIPP.cmake
@@ -163,9 +163,16 @@
         ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
         ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
         ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
-        ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
-        PARENT_SCOPE)
-
+        ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
+
+    if (UNIX)
+        set(IPP_LIBRARIES
+            ${IPP_LIBRARIES}
+            ${IPP_LIB_PREFIX}irc${CMAKE_SHARED_LIBRARY_SUFFIX}
+            ${IPP_LIB_PREFIX}imf${CMAKE_SHARED_LIBRARY_SUFFIX}
+            ${IPP_LIB_PREFIX}svml${CMAKE_SHARED_LIBRARY_SUFFIX})
+    endif()
+    set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
     return()

 endfunction()
@@ -208,18 +215,38 @@
         set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)

         if (APPLE)
-            set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
+            set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib)
         elseif (IPP_X64)
             if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
                 message(SEND_ERROR "IPP EM64T libraries not found")
             endif()
-            set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/intel64 PARENT_SCOPE)
+            set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/intel64)
         else()
             if(NOT EXISTS ${IPP_ROOT_DIR}/lib/ia32)
                 message(SEND_ERROR "IPP IA32 libraries not found")
             endif()
-            set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE)
-        endif()
+            set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32)
+        endif()
+
+        if (UNIX)
+            get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../lib REALPATH)
+            if (IPP_X64)
+                if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/intel64)
+                    message(SEND_ERROR "Intel compiler EM64T libraries not found")
+                endif()
+                set(IPP_LIBRARY_DIRS
+                    ${IPP_LIBRARY_DIRS}
+                    ${INTEL_COMPILER_LIBRARY_DIR}/intel64)
+            else()
+                if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/ia32)
+                    message(SEND_ERROR "Intel compiler IA32 libraries not found")
+                endif()
+                set(IPP_LIBRARY_DIRS
+                    ${IPP_LIBRARY_DIRS}
+                    ${INTEL_COMPILER_LIBRARY_DIR}/ia32)
+            endif()
+        endif()
+        set(IPP_LIBRARY_DIRS ${IPP_LIBRARY_DIRS} PARENT_SCOPE)

         # set IPP_LIBRARIES variable (7.x or 8.x lib names)
         set_ipp_new_libraries(${_LATEST_VERSION})


Fix for problem with the CMake XCode generator ignoring the CMAKE_BUILD_TYPE value.

--- cmake/PlatformMacOS.cmake
+++ cmake/PlatformMacOS.cmake
@@ -12,7 +12,20 @@

 else ()

-	message(STATUS "Configuring for platform MacOS with XCode Version 5+.")
+    message(STATUS "Configuring for platform MacOS with XCode Version 5+.")
+
+    # The XCode generator seems to ignore the value in the CMAKE_BUILD_TYPE variable.
+    # Instead, it uses the first value of the CMAKE_CONFIGURATION_TYPES list as build
+    # type (cf. http://www.cmake.org/pipermail/cmake/2006-December/012288.html)
+    # Therefore, we re-define the CMAKE_CONFIGURATION_TYPES here according to the value
+    # in CMAKE_BUILD_TYPES.
+    if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
+	set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
+	message(STATUS ">> Re-defining as follows: CMAKE_CONFIGURATION_TYPES = ${CMAKE_CONFIGURATION_TYPES}")
+    else ()
+	set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
+	message(STATUS ">> Re-defining as follows: CMAKE_CONFIGURATION_TYPES = ${CMAKE_CONFIGURATION_TYPES}")
+    endif()

 endif()


CMake: cleanup style a bit

CMake: cleanup style a bit

--- cmake/bitcode_rules.cmake
+++ cmake/bitcode_rules.cmake
@@ -128,13 +128,13 @@
   compile_to_bc(BC_LIST ${ARGN})

   # fix too long commandline with cat and xargs
-  SET(BC_LIST_FILE_TXT "")
+  set(BC_LIST_FILE_TXT "")
   foreach(FILENAME ${BC_LIST})
     # straight parsing semicolon separated list with xargs -d didn't work on windows.. no such switch available
-    SET(BC_LIST_FILE_TXT "${BC_LIST_FILE_TXT} \"${FILENAME}\"")
+    set(BC_LIST_FILE_TXT "${BC_LIST_FILE_TXT} \"${FILENAME}\"")
   endforeach()
-  SET (BC_LIST_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/kernel_${NAME}_linklist.txt")
-  FILE (WRITE "${BC_LIST_FILE}" "${BC_LIST_FILE_TXT}")
+  set(BC_LIST_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/kernel_${NAME}_linklist.txt")
+  file(WRITE "${BC_LIST_FILE}" "${BC_LIST_FILE_TXT}")

   add_custom_command( OUTPUT "${KERNEL_BC}"
 # ${KERNEL_BC}: ${OBJ}


Manually merging cmake support

Manually merging cmake support

--- cmake/cmake_install.cmake
+++ cmake/cmake_install.cmake
@@ -1,39 +0,0 @@
-# Install script for directory: /Users/dennisluxen/Coding/Project-OSRM
-
-# Set the install prefix
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  SET(CMAKE_INSTALL_PREFIX "/usr/local")
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  IF(BUILD_TYPE)
-    STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  ELSE(BUILD_TYPE)
-    SET(CMAKE_INSTALL_CONFIG_NAME "")
-  ENDIF(BUILD_TYPE)
-  MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-
-# Set the component getting installed.
-IF(NOT CMAKE_INSTALL_COMPONENT)
-  IF(COMPONENT)
-    MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
-    SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  ELSE(COMPONENT)
-    SET(CMAKE_INSTALL_COMPONENT)
-  ENDIF(COMPONENT)
-ENDIF(NOT CMAKE_INSTALL_COMPONENT)
-
-IF(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-ELSE(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-ENDIF(CMAKE_INSTALL_COMPONENT)
-
-FILE(WRITE "/Users/dennisluxen/Coding/Project-OSRM/${CMAKE_INSTALL_MANIFEST}" "")
-FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
-  FILE(APPEND "/Users/dennisluxen/Coding/Project-OSRM/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
-ENDFOREACH(file)


Fix #42. Close #42.wq

Fix #42.
Close #42.wq

--- cmake/enable_python.cmake
+++ cmake/enable_python.cmake
@@ -68,8 +68,13 @@

     foreach(pkg ${${pkg_name}_PACKAGES})
       get_filename_component(name ${pkg} NAME)
-      execute_process(COMMAND /bin/ln -sf
-        ${CMAKE_CURRENT_SOURCE_DIR}/${pkg} ${CMAKE_BINARY_DIR}/lib/${name})
+      #prevent recursive sim links by checking first?
+      #TODO can this be done by using a different arg syntax to ln
+      #ln source/ target/ ?
+      if(NOT EXISTS ${CMAKE_BINARY_DIR}/lib/${name})
+        execute_process(COMMAND /bin/ln -sf
+          ${CMAKE_CURRENT_SOURCE_DIR}/${pkg} ${CMAKE_BINARY_DIR}/lib/${name})
+      endif()
     endforeach()

     foreach(script ${${pkg_name}_SCRIPTS})
@@ -95,4 +100,4 @@
 function(enable_python)
   message(WARNING "CMAKE macro enable_python replaced by catkin_export_python")
   catkin_export_python(${ARGN})
-endfunction()+endfunction()


fix typo

fix typo

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -102,7 +102,7 @@
   set(dst_dir "${CMAKE_INSTALL_PREFIX}/third_party/install/mkldnn")
   copy(mkldnn_lib
     SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB}
-    DSTS ${dst} ${dst_dir}/lib
+    DSTS ${dst_dir} ${dst_dir}/lib
   )
 endif()


strip inference.so and make link to mkldnn.so (#34895)

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -72,6 +72,12 @@
             copy(${TARGET}
                     SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR}
                     DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir})
+            if(WITH_STRIP)
+                    add_custom_command(TARGET ${TARGET} POST_BUILD
+                            COMMAND strip -s ${dst_dir}/lib/libiomp5.so
+                            COMMAND strip -s ${dst_dir}/lib/libmklml_intel.so
+                            COMMENT "striping libiomp5.so\nstriping libmklml_intel.so")
+            endif()
         endif()
     elseif(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
         set(dst_dir "${DST}/third_party/install/openblas")
@@ -94,8 +100,17 @@
                     DSTS ${dst_dir} ${dst_dir}/lib ${dst_dir}/lib)
         else()
             copy(${TARGET}
-                    SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB} ${MKLDNN_SHARED_LIB_1} ${MKLDNN_SHARED_LIB_2}
-                    DSTS ${dst_dir} ${dst_dir}/lib ${dst_dir}/lib ${dst_dir}/lib)
+                    SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB}
+                    DSTS ${dst_dir} ${dst_dir}/lib)
+            if(WITH_STRIP)
+                    add_custom_command(TARGET ${TARGET} POST_BUILD
+                            COMMAND strip -s ${dst_dir}/lib/libmkldnn.so.0
+                            COMMENT "striping libmkldnn.so.0")
+            endif()
+            add_custom_command(TARGET ${TARGET} POST_BUILD
+                    COMMAND ${CMAKE_COMMAND} -E create_symlink libmkldnn.so.0 ${dst_dir}/lib/libdnnl.so.1
+                    COMMAND ${CMAKE_COMMAND} -E create_symlink libmkldnn.so.0 ${dst_dir}/lib/libdnnl.so.2
+                    COMMENT "Make a symbol link of libmkldnn.so.0")
         endif()
     endif()

@@ -224,6 +239,13 @@
 copy(inference_lib_dist
       SRCS  ${src_dir}/inference/capi_exp/pd_*.h  ${paddle_inference_c_lib}
       DSTS  ${PADDLE_INFERENCE_C_INSTALL_DIR}/paddle/include ${PADDLE_INFERENCE_C_INSTALL_DIR}/paddle/lib)
+
+if(WITH_STRIP AND NOT WIN32)
+        add_custom_command(TARGET inference_lib_dist POST_BUILD
+                COMMAND strip -s ${PADDLE_INFERENCE_C_INSTALL_DIR}/paddle/lib/libpaddle_inference_c.so
+                COMMAND strip -s ${PADDLE_INFERENCE_INSTALL_DIR}/paddle/lib/libpaddle_inference.so
+                COMMENT "striping libpaddle_inference_c.so\nstriping libpaddle_inference.so")
+endif()

 # fluid library for both train and inference
 set(fluid_lib_deps inference_lib_dist)


AddCompilerFlags: don't test for C++ flags with the C compiler

Spotted by Jørgen Ibsen.

--- cmake/AddCompilerFlags.cmake
+++ cmake/AddCompilerFlags.cmake
@@ -100,7 +100,7 @@
     unset (c_test_name)

     string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" cxx_test_name "CFLAG_${flag_to_test}")
-    CHECK_C_COMPILER_FLAG ("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${cxx_test_name})
+    CHECK_CXX_COMPILER_FLAG ("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${cxx_test_name})
     if (${cxx_test_name})
       set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
     endif ()


restored OpenBLAS detection; fixed MKL's lapack header (#7921)

--- cmake/OpenCVFindLAPACK.cmake
+++ cmake/OpenCVFindLAPACK.cmake
@@ -12,20 +12,20 @@
             set(LAPACK_INCLUDE_DIR  ${MKL_INCLUDE_DIRS})
             set(LAPACK_LIBRARIES    ${MKL_LIBRARIES}   )
             set(LAPACK_CBLAS_H      "mkl_cblas.h"      )
-            set(LAPACK_LAPACKE_H    "mkl_lapacke.h"    )
+            set(LAPACK_LAPACKE_H    "mkl_lapack.h"    )
             set(LAPACK_IMPL         "MKL")
         endif()
     endif()
-    #if(NOT LAPACK_LIBRARIES)
-    #    include(cmake/OpenCVFindOpenBLAS.cmake)
-    #    if(OpenBLAS_FOUND)
-    #        set(LAPACK_INCLUDE_DIR  ${OpenBLAS_INCLUDE_DIR} )
-    #        set(LAPACK_LIBRARIES    ${OpenBLAS_LIB}         )
-    #        set(LAPACK_CBLAS_H      "cblas.h"      )
-    #        set(LAPACK_LAPACKE_H    "lapacke.h"    )
-    #        set(LAPACK_IMPL         "OpenBLAS")
-    #    endif()
-    #endif()
+    if(NOT LAPACK_LIBRARIES)
+        include(cmake/OpenCVFindOpenBLAS.cmake)
+        if(OpenBLAS_FOUND)
+            set(LAPACK_INCLUDE_DIR  ${OpenBLAS_INCLUDE_DIR} )
+            set(LAPACK_LIBRARIES    ${OpenBLAS_LIB}         )
+            set(LAPACK_CBLAS_H      "cblas.h"      )
+            set(LAPACK_LAPACKE_H    "lapacke.h"    )
+            set(LAPACK_IMPL         "OpenBLAS")
+        endif()
+    endif()
     if(NOT LAPACK_LIBRARIES AND UNIX)
         include(cmake/OpenCVFindAtlas.cmake)
         if(ATLAS_FOUND)


build: remove `LINK_LIBRARIES` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -679,7 +679,6 @@
 #     [SDK sdk]
 #     [ARCHITECTURE architecture]
 #     [DEPENDS dep1 ...]
-#     [LINK_LIBRARIES dep1 ...]
 #     [FRAMEWORK_DEPENDS dep1 ...]
 #     [FRAMEWORK_DEPENDS_WEAK dep1 ...]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
@@ -709,9 +708,6 @@
 #
 # DEPENDS
 #   Targets that this library depends on.
-#
-# LINK_LIBRARIES
-#   Libraries this library depends on.
 #
 # FRAMEWORK_DEPENDS
 #   System frameworks this library depends on.
@@ -758,7 +754,6 @@
         INCORPORATE_OBJECT_LIBRARIES
         INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
         LINK_FLAGS
-        LINK_LIBRARIES
         LLVM_LINK_COMPONENTS
         PRIVATE_LINK_LIBRARIES
         SWIFT_COMPILE_FLAGS)
@@ -849,8 +844,6 @@
       -libc;${SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY})
   endif()

-  # FIXME: don't actually depend on the libraries in SWIFTLIB_SINGLE_LINK_LIBRARIES,
-  # just any swiftmodule files that are associated with them.
   handle_swift_sources(
       swift_object_dependency_target
       swift_module_dependency_target
@@ -863,7 +856,6 @@
         ${gyb_dependency_targets}
         ${SWIFTLIB_SINGLE_DEPENDS}
         ${SWIFTLIB_SINGLE_FILE_DEPENDS}
-        ${SWIFTLIB_SINGLE_LINK_LIBRARIES}
       SDK ${SWIFTLIB_SINGLE_SDK}
       ARCHITECTURE ${SWIFTLIB_SINGLE_ARCHITECTURE}
       MODULE_NAME ${module_name}
@@ -1011,20 +1003,6 @@
         "${swift_module_dependency_target}"
         ${LLVM_COMMON_DEPENDS})

-  if("${libkind}" STREQUAL "SHARED")
-    target_link_libraries("${target}" PRIVATE ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
-  else()
-    target_link_libraries("${target}" INTERFACE ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
-  endif()
-
-  # Don't add the icucore target.
-  set(SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU)
-  foreach(item ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
-    if(NOT "${item}" STREQUAL "icucore")
-      list(APPEND SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU "${item}")
-    endif()
-  endforeach()
-
   # Link against system frameworks.
   foreach(FRAMEWORK ${SWIFTLIB_SINGLE_FRAMEWORK_DEPENDS})
     target_link_libraries(${target} PUBLIC "-framework ${FRAMEWORK}")
@@ -1093,7 +1071,6 @@
     DEPLOYMENT_VERSION_TVOS "${SWIFTLIB_DEPLOYMENT_VERSION_TVOS}"
     DEPLOYMENT_VERSION_WATCHOS "${SWIFTLIB_DEPLOYMENT_VERSION_WATCHOS}"
     RESULT_VAR_NAME link_flags
-    LINK_LIBRARIES_VAR_NAME link_libraries
     LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories
       )

@@ -1172,7 +1149,7 @@
   # import library targets when the library was added.  Use that to adjust the
   # link libraries.
   if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
-    foreach(library_list LINK_LIBRARIES PRIVATE_LINK_LIBRARIES)
+    foreach(library_list PRIVATE_LINK_LIBRARIES)
       set(import_libraries)
       foreach(library ${SWIFTLIB_SINGLE_${library_list}})
         # Ensure that the library is a target.  If an absolute path was given,


build: dereference some variables for android x64

These variables need to be dereferenced on some versions of CMake.  This
should fix the android x64 nightlies.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -288,8 +288,8 @@
     endif()
   endif()

-  if(CFLAGS_SDK STREQUAL ANDROID)
-    if(CFLAGS_ARCH STREQUAL x86_64)
+  if(${CFLAGS_SDK} STREQUAL ANDROID)
+    if(${CFLAGS_ARCH} STREQUAL x86_64)
       # NOTE(compnerd) Android NDK 21 or lower will generate library calls to
       # `__sync_val_compare_and_swap_16` rather than lowering to the CPU's
       # `cmpxchg16b` instruction as the `cx16` feature is disabled due to a bug


[R-package] fixed inconsistency in R -e calls in FindLibR.cmake (#5438)

--- cmake/modules/FindLibR.cmake
+++ cmake/modules/FindLibR.cmake
@@ -103,12 +103,12 @@
     )
     # ask R for the include dir
     execute_process(
-      COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('include'))"
+      COMMAND ${LIBR_EXECUTABLE} "--slave" "--vanilla" "-e" "cat(R.home('include'))"
       OUTPUT_VARIABLE LIBR_INCLUDE_DIRS
     )
     # ask R for the lib dir
     execute_process(
-      COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('lib'))"
+      COMMAND ${LIBR_EXECUTABLE} "--slave" "--vanilla" "-e" "cat(R.home('lib'))"
       OUTPUT_VARIABLE LIBR_LIB_DIR
     )


- Fix Snappy builds on new Ubuntu Docker containers, added environment variable

--- cmake/Packaging/LinuxSnappyBuild.cmake
+++ cmake/Packaging/LinuxSnappyBuild.cmake
@@ -180,20 +180,25 @@
         "${SNAPPY_PKG_DIR}/snap-select.sh"
         )

+    set ( PYTHON_ENCODING_STUFF LC_ALL=C.UTF-8 LANG=C.UTF-8 )
+
     add_custom_command ( TARGET ${TARGET}
         POST_BUILD
-        COMMAND python2 ${SNAPPY_PROGRAM} clean
+        COMMAND ${PYTHON_ENCODING_STUFF} ${SNAPPY_PROGRAM} clean
         WORKING_DIRECTORY ${SNAPPY_PKG_DIR}
+        USES_TERMINAL
 	)
     add_custom_command ( TARGET ${TARGET}
         POST_BUILD
-        COMMAND python2 ${SNAPPY_PROGRAM} build
+        COMMAND ${PYTHON_ENCODING_STUFF} ${SNAPPY_PROGRAM} build
         WORKING_DIRECTORY ${SNAPPY_PKG_DIR}
+        USES_TERMINAL
         )
     add_custom_command ( TARGET ${TARGET}
         POST_BUILD
-        COMMAND python2 ${SNAPPY_PROGRAM} snap -o "${SNAPPY_FINAL_SNAP}"
+        COMMAND ${PYTHON_ENCODING_STUFF} ${SNAPPY_PROGRAM} snap -o "${SNAPPY_FINAL_SNAP}"
         WORKING_DIRECTORY ${SNAPPY_PKG_DIR}
+        USES_TERMINAL
         )

     install (


ERR: Missing link directories to png and zlib libraries.

--- itkCMakeOptions.cmake
+++ itkCMakeOptions.cmake
@@ -18,6 +18,8 @@

 # set link libraries
 LINK_DIRECTORIES(
+${ITK_BINARY_DIR}/Utilities/zlib
+${ITK_BINARY_DIR}/Utilities/png
 ${ITK_BINARY_DIR}/Code/Common
 ${ITK_BINARY_DIR}/Code/Numerics/vxl )


COMP: Disable BUILD_TESTING of elastix

COMP: Disable BUILD_TESTING of elastix

CMake flag ELASTIX_BUILD_TESTING was renamed to BUILD_TESTING in commit
6d27d4c2ef46687e522fd92f279b98e73c1ee68a, which was not reflected in our
ExternalBuild.
(Same for ELASTIX_SHARED_LIBS: d2c91e9afe333d5a12aa116b33a69909bb4d8fe6)

--- SuperBuild/ExternalElastix.cmake
+++ SuperBuild/ExternalElastix.cmake
@@ -33,9 +33,9 @@
   CMAKE_GENERATOR ${gen}
   CMAKE_ARGS
   --no-warn-unused-cli
-  -DELASTIX_BUILD_TESTING:BOOL=OFF
+  -DBUILD_TESTING:BOOL=OFF
   -DELASTIX_BUILD_EXECUTABLE:BOOL=OFF
-  -DELASTIX_BUILD_SHARED_LIBS:BOOL=${SUPERELASTIX_BUILD_SHARED_LIBS}
+  -DBUILD_SHARED_LIBS:BOOL=${SUPERELASTIX_BUILD_SHARED_LIBS}
   -DCMAKE_CONFIGURATION_TYPES:STRING=${CMAKE_CONFIGURATION_TYPES}
   -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
   -DITK_DIR:PATH=${ITK_DIR}


Linux cmake fmodex 64-bit support for autobuild type builds. (!standalone)

--- indra/cmake/FMODEX.cmake
+++ indra/cmake/FMODEX.cmake
@@ -40,9 +40,15 @@
             debug fmodexL
             optimized fmodex)
       elseif (LINUX)
-        set(FMODEX_LIBRARY
-            debug fmodexL
-            optimized fmodex)
+        if(ND_BUILD64BIT_ARCH)
+          set(FMODEX_LIBRARY
+              debug fmodexL64
+              optimized fmodex64)
+        else(ND_BUILD64BIT_ARCH)
+          set(FMODEX_LIBRARY
+              debug fmodexL
+              optimized fmodex)
+        endif(ND_BUILD64BIT_ARCH)
       endif (WINDOWS)
       set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
       set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodex)


Incomplete - task references #242: Ajout de Curl

--- CMake/DependenciesXsilium.cmake
+++ CMake/DependenciesXsilium.cmake
@@ -327,6 +327,7 @@

 #Find Curl
 set(CURL_INCLUDE "${CMAKE_SOURCE_DIR}/Library/Curl/include")
+set(CURL_LIBRARY "curl")

 #Find Librsync
 set(RSYNC_INCLUDE "${CMAKE_SOURCE_DIR}/Library/Librsync")


Need to still define OGRE_DEP_DIR in InstallDependencies.cmake, but derive it a different way

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

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -12,6 +12,12 @@
 #####################################################
 if ((NOT APPLE) AND (NOT WIN32))
   return()
+endif()
+
+if (OGRE_DEPENDENCIES_DIR)
+	set(OGRE_DEP_DIR ${OGRE_DEPENDENCIES_DIR})
+else()
+	set(OGRE_DEP_DIR "${OGRE_SOURCE_DIR}/Dependencies")
 endif()

 option(OGRE_INSTALL_DEPENDENCIES "Install dependency libs needed for samples" TRUE)


No need to check if we are with cmake > 2.8

--- CMake/OTBModuleHeaderTest.cmake
+++ CMake/OTBModuleHeaderTest.cmake
@@ -96,23 +96,21 @@

     # We check to see if the headers are changed.  If so, remove the header test
     # source files so they are regenerated.
-    if( ${CMAKE_VERSION} VERSION_GREATER 2.8.6 ) # for string( MD5
-      set( _headers_list_md5 "${${_name}_BINARY_DIR}/test/CMakeFiles/HeadersList.md5" )
-      list( SORT _header_files )
-      string( MD5 _new_md5 "${_header_files}" )
-      set( _regenerate_sources FALSE )
-      if( NOT EXISTS "${_headers_list_md5}" )
+    set( _headers_list_md5 "${${_name}_BINARY_DIR}/test/CMakeFiles/HeadersList.md5" )
+    list( SORT _header_files )
+    string( MD5 _new_md5 "${_header_files}" )
+    set( _regenerate_sources FALSE )
+    if( NOT EXISTS "${_headers_list_md5}" )
+      set( _regenerate_sources TRUE )
+    else()
+      file( READ "${_headers_list_md5}" _old_md5 )
+      if( NOT ("${_old_md5}" STREQUAL "${_new_md5}"))
         set( _regenerate_sources TRUE )
-      else()
-        file( READ "${_headers_list_md5}" _old_md5 )
-        if( NOT ("${_old_md5}" STREQUAL "${_new_md5}"))
-          set( _regenerate_sources TRUE )
-        endif()
       endif()
-      file( WRITE "${_headers_list_md5}" "${_new_md5}" )
-      if( ${_regenerate_sources} )
-        file( REMOVE ${_outputs} )
-      endif()
+    endif()
+    file( WRITE "${_headers_list_md5}" "${_new_md5}" )
+    if( ${_regenerate_sources} )
+      file( REMOVE ${_outputs} )
     endif()

     set( _test_num 1 )


ENH: backout 0f1c85b013ea (temporary)

ENH: backout 0f1c85b013ea (temporary)

--- CMake/OTBModuleHeaderTest.cmake
+++ CMake/OTBModuleHeaderTest.cmake
@@ -22,17 +22,17 @@

 SET(BANNED_HEADERS)
-if(NOT OTB_USE_OPENCV)
-	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} "otbDecisionTreeMachineLearningModelFactory.h otbDecisionTreeMachineLearningModel.h otbKNearestNeighborsMachineLearningModelFactory.h otbKNearestNeighborsMachineLearningModel.h otbRandomForestsMachineLearningModelFactory.h otbRandomForestsMachineLearningModel.h otbSVMMachineLearningModelFactory.h otbSVMMachineLearningModel.h otbGradientBoostedTreeMachineLearningModelFactory.h otbGradientBoostedTreeMachineLearningModel.h otbBoostMachineLearningModelFactory.h otbBoostMachineLearningModel.h otbNeuralNetworkMachineLearningModelFactory.h otbNeuralNetworkMachineLearningModel.h otbNormalBayesMachineLearningModelFactory.h otbNormalBayesMachineLearningModel.h otbRequiresOpenCVCheck.h ")
-	string(STRIP ${BANNED_HEADERS} BANNED_HEADERS)
-	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} " ")
-endif()
+#if(NOT OTB_USE_OPENCV)
+#	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} "otbDecisionTreeMachineLearningModelFactory.h otbDecisionTreeMachineLearningModel.h otbKNearestNeighborsMachineLearningModelFactory.h otbKNearestNeighborsMachineLearningModel.h otbRandomForestsMachineLearningModelFactory.h otbRandomForestsMachineLearningModel.h otbSVMMachineLearningModelFactory.h otbSVMMachineLearningModel.h otbGradientBoostedTreeMachineLearningModelFactory.h otbGradientBoostedTreeMachineLearningModel.h otbBoostMachineLearningModelFactory.h otbBoostMachineLearningModel.h otbNeuralNetworkMachineLearningModelFactory.h otbNeuralNetworkMachineLearningModel.h otbNormalBayesMachineLearningModelFactory.h otbNormalBayesMachineLearningModel.h otbRequiresOpenCVCheck.h ")
+#	string(STRIP ${BANNED_HEADERS} BANNED_HEADERS)
+#	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} " ")
+#endif()

-if(NOT OTB_USE_LIBSVM)
-	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} "otbLibSVMMachineLearningModel.h otbLibSVMMachineLearningModelFactory.h")
-	string(STRIP ${BANNED_HEADERS} BANNED_HEADERS)
-	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} " ")
-endif()
+#if(NOT OTB_USE_LIBSVM)
+#	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} "otbLibSVMMachineLearningModel.h otbLibSVMMachineLearningModelFactory.h")
+#	string(STRIP ${BANNED_HEADERS} BANNED_HEADERS)
+#	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} " ")
+#endif()

 # ************ ADD YOUR BANNED HEADERS HERE ************
 #if(CONDITION)
@@ -41,7 +41,7 @@
 #	string(CONCAT BANNED_HEADERS ${BANNED_HEADERS} " ")
 #endif()

-string(STRIP ${BANNED_HEADERS} BANNED_HEADERS)
+#string(STRIP ${BANNED_HEADERS} BANNED_HEADERS)


respect FreeImage config in AndroidMacro

--- CMake/Utils/AndroidMacros.cmake
+++ CMake/Utils/AndroidMacros.cmake
@@ -47,8 +47,12 @@
 	if(OGRE_CONFIG_ENABLE_GLES2_GLSL_OPTIMISER)
         add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_ABI@"  "glsl_optimizer" "glcpp-library" "mesa")
 	endif()
-
-	add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_ABI@" "OIS" "freetype" "FreeImage" "zzip")
+
+	if(OGRE_CONFIG_ENABLE_FREEIMAGE)
+        add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_ABI@" "FreeImage")
+    endif()
+
+	add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_ABI@" "OIS" "freetype" "zzip")

     if(APPLE OR WIN32)
       SET(ANDROID_EXECUTABLE "android")


Adding additional directories to search for the Ogre framework when using a prebuilt SDK with your own projects under OS X

--HG--
branch : v1-7

--- CMake/Utils/FindPkgMacros.cmake
+++ CMake/Utils/FindPkgMacros.cmake
@@ -131,6 +131,10 @@
       /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Release
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
+      ${OGRE_PREFIX_PATH}/lib/Release
+      ${OGRE_PREFIX_PATH}/lib/Debug
+      ${OGRE_PREFIX_BUILD}/lib/Release
+      ${OGRE_PREFIX_BUILD}/lib/Debug
     )
     FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
       SET(fwkpath ${dir}/${fwk}.framework)


Do not warn about python version when python not found

Change-Id: Ib2879197210e5dfda4b38b2127647714e270a515

--- CMake/sitkLanguageOptions.cmake
+++ CMake/sitkLanguageOptions.cmake
@@ -70,7 +70,8 @@
 find_package ( PythonInterp ${_QUIET})
 find_package ( PythonLibs ${PYTHON_VERSION_STRING} EXACT ${_QUIET_LIBRARY} )

-if (PYTHON_VERSION_STRING VERSION_LESS 2.6)
+if ( PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND
+    AND PYTHON_VERSION_STRING VERSION_LESS 2.6 )
   message( WARNING "Python version less that 2.6: \"${PYTHON_VERSION_STRING}\"." )
 endif()


Fix regression ensuring macro VTK_MAKE_INSTANTIATOR3 configure files

This commit fixes a regression introduced by Kitware/VTK@3bf2fb76
and apply to  a patch similar to Kitware/VTK@d7f7154, Kitware/VTK@9d8e8a7,
Kitware/VTK@d7f7154, Kitware/VTK@d7f7154 respectively applied to
CMake/vtkWrapHierarchy.cmake, CMake/vtkWrapPython.cmake,
CMake/vtkWrapPythonSIP.cmake, CMake/vtkWrapTcl.cmake

Fixes #15253 - http://www.paraview.org/Bug/view.php?id=15253

Change-Id: I39f960ab888b85f5f9aba752752ad9951755408e

--- CMake/vtkMakeInstantiator.cmake
+++ CMake/vtkMakeInstantiator.cmake
@@ -152,12 +152,12 @@
   CONFIGURE_FILE(
     ${VTK_CMAKE_DIR}/vtkMakeInstantiator.h.in
     ${HEADER_LOCATION}/${className}.h
-    COPYONLY
+    @ONLY
     )
   CONFIGURE_FILE(
     ${VTK_CMAKE_DIR}/vtkMakeInstantiator.cxx.in
     ${CMAKE_CURRENT_BINARY_DIR}/${className}.cxx
-    COPYONLY
+    @ONLY
     )

 ENDMACRO()