update FindLIBZIP

update FindLIBZIP

--- cmake/FindLIBZIP.cmake
+++ cmake/FindLIBZIP.cmake
@@ -2,9 +2,17 @@
 #
 # Find the native libzip headers and libraries.
 #
+# This will define the following variables:
+#
 #   LIBZIP_INCLUDE_DIRS   - libzip include dirs
 #   LIBZIP_LIBRARIES      - List of libraries to link when using libzip.
 #   LIBZIP_FOUND          - True if libzip found.
+#
+# and the following imported targets
+#
+#   LIBZIP::LIBZIP
+#
+# @author Lars Ivar Hatledal

 find_path(LIBZIP_INCLUDE_DIR NAMES zip.h)
 mark_as_advanced(LIBZIP_INCLUDE_DIR)
@@ -13,26 +21,23 @@
 mark_as_advanced(LIBZIP_LIBRARY)

 include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBZIP
+        REQUIRED_VARS LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR)

-if (UNIX)
+if (LIBZIP_FOUND)

-    find_package(ZLIB REQUIRED)
-    find_package(BZip2 REQUIRED)
-    find_package(OpenSSL REQUIRED)
+    set(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIR})

-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBZIP
-            REQUIRED_VARS LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR)
+    if (NOT LIBZIP_LIBRARIES)
+        set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY})
+    endif()

-    set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${OPENSSL_LIBRARIES})
+    if (NOT TARGET LIBZIP::LIBZIP)
+        add_library(LIBZIP::LIBZIP UNKNOWN IMPORTED)
+        set_target_properties(LIBZIP::LIBZIP PROPERTIES
+                INTERFACE_INCLUDE_DIRECTORIES "${LIBZIP_INCLUDE_DIR}")
+        set_property(TARGET LIBZIP::LIBZIP APPEND PROPERTY
+                IMPORTED_LOCATION "${LIBZIP_LIBRARY}")
+    endif()

-else ()
-
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBZIP
-            REQUIRED_VARS LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR)
-
-    set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY})
-
-endif ()
-
-set(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIR})
-
+endif()


Add support for detecting libeio as ev-eio

--- cmake/FindLibEio.cmake
+++ cmake/FindLibEio.cmake
@@ -4,11 +4,15 @@
 	PATHS /usr/local /usr
 )
 find_library(LIBEIO_LIBRARY
-  NAMES eio
+  NAMES ev-eio eio
   HINTS $ENV{LIBEIO_DIR}
   PATH_SUFFIXES lib
   PATHS /usr/local /usr
 )
+check_library_exists(${LIBEIO_LIBRARY} eio_custom  "" EIO_CUSTOM_IS_PRESENT)
+if (NOT EIO_CUSTOM_IS_PRESENT)
+	message(FATAL_ERROR "symbol eio_custom is not found in ${LIBEIO_LIBRARY}")
+endif()
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(LibEio DEFAULT_MSG LIBEIO_LIBRARY LIBEIO_INCLUDE_DIR)
 mark_as_advanced(LIBEIO_INCLUDE_DIR LIBEIO_LIBRARY)


Update FindLuaJIT.cmake

Update FindLuaJIT.cmake

--- cmake/FindLuaJIT.cmake
+++ cmake/FindLuaJIT.cmake
@@ -10,6 +10,7 @@
     c:/usr/local/lib
     c:/usr/local
     c:/usr
+    c:/
     $ENV{LUAJIT_DIR}
     )


Added 2015b

Added 2015b

--- cmake/FindMatlab.cmake
+++ cmake/FindMatlab.cmake
@@ -228,6 +228,7 @@
 endif()

 set(MATLAB_VERSIONS_MAPPING
+  "R2015b=8.6"
   "R2015a=8.5"
   "R2014b=8.4"
   "R2014a=8.3"


Added new service AWSPricing into SDK. (#220)

Added new service AWSPricing into SDK.

--- cmake/sdksCommon.cmake
+++ cmake/sdksCommon.cmake
@@ -102,6 +102,7 @@
 list(APPEND C2J_LIST "organizations:2016-11-28")
 list(APPEND C2J_LIST "polly:2016-06-10")
 list(APPEND C2J_LIST "pinpoint:2016-12-01")
+list(APPEND C2J_LIST "pricing:2017-10-15")
 list(APPEND C2J_LIST "rds:2014-10-31")
 list(APPEND C2J_LIST "redshift:2012-12-01")
 list(APPEND C2J_LIST "rekognition:2016-06-27")


Export each definition individually

Export each definition individually

This allows using each definition (resulting from BackwardConfig.cmake)
separately, e.g., in conjunction with cmake's configure_file() command
and thus can be defined in a cmake-generated source file before a build.

Example:

Config.h.in
===========
 #cmakedefine01 BACKWARD_HAS_UNWIND
 #cmakedefine01 BACKWARD_HAS_BACKTRACE
 #cmakedefine01 BACKWARD_HAS_BACKTRACE_SYMBOL
 #cmakedefine01 BACKWARD_HAS_DW
 #cmakedefine01 BACKWARD_HAS_BFD
 #cmakedefine01 BACKWARD_HAS_DWARF

CMakeLists.txt:
===============
 include(BackwardConfig)
 configure_file( "${PROJECT_SOURCE_DIR}/Config.h.in"
                 "${PROJECT_BINARY_DIR}/Config.h" )

SomeProjectFile.C:
==================
 #include "Config.h"      // generated by cmake based on Config.h.in
 #include "backward.hpp"  // backward-cpp now configured based on BackwardConfig.cmake

 using namespace backward;
 StackTrace st; st.load_here(32);
 Printer p; p.print(st);

--- BackwardConfig.cmake
+++ BackwardConfig.cmake
@@ -180,6 +180,16 @@
 set(BACKWARD_LIBRARIES ${_BACKWARD_LIBRARIES} CACHE INTERNAL "BACKWARD_LIBRARIES")
 mark_as_advanced(BACKWARD_INCLUDE_DIRS BACKWARD_DEFINITIONS BACKWARD_LIBRARIES)

+# Expand each definition in BACKWARD_DEFINITIONS to its own cmake var and export
+# to outer scope
+foreach(var ${BACKWARD_DEFINITIONS})
+  string(REPLACE "=" ";" var_as_list ${var})
+  list(GET var_as_list 0 var_name)
+  list(GET var_as_list 1 var_value)
+  set(${var_name} ${var_value})
+  mark_as_advanced(${var_name})
+endforeach()
+
 if (NOT TARGET Backward::Backward)
 	add_library(Backward::Backward INTERFACE IMPORTED)
 	set_target_properties(Backward::Backward PROPERTIES


fix build

fix build

--- CMake/FindGLFW.cmake
+++ CMake/FindGLFW.cmake
@@ -195,41 +195,6 @@
         set (GLFW_INCLUDE_PATH "${GLFW_INCLUDE_DIR}")
     endif(GLFW_glfw_LIBRARY)

-
-    # Tease the GLFW_VERSION numbers from the lib headers
-    function(parseVersion FILENAME VARNAME)
-
-        set(PATTERN "^#define ${VARNAME}.*$")
-
-        file(STRINGS "${GLFW_INCLUDE_DIR}/${FILENAME}" TMP REGEX ${PATTERN})
-
-        string(REGEX MATCHALL "[0-9]+" TMP ${TMP})
-
-        set(${VARNAME} ${TMP} PARENT_SCOPE)
-
-    endfunction()
-
-
-    if(EXISTS "${GLFW_INCLUDE_DIR}/GL/glfw.h")
-
-        parseVersion(GL/glfw.h GLFW_VERSION_MAJOR)
-        parseVersion(GL/glfw.h GLFW_VERSION_MINOR)
-        parseVersion(GL/glfw.h GLFW_VERSION_REVISION)
-
-    elseif(EXISTS "${GLFW_INCLUDE_DIR}/GLFW/glfw3.h")
-
-        parseVersion(GLFW/glfw3.h GLFW_VERSION_MAJOR)
-        parseVersion(GLFW/glfw3.h GLFW_VERSION_MINOR)
-        parseVersion(GLFW/glfw3.h GLFW_VERSION_REVISION)
-
-    endif()
-
-    if(${GLFW_VERSION_MAJOR} OR ${GLFW_VERSION_MINOR} OR ${GLFW_VERSION_REVISION})
-        set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}.${GLFW_VERSION_REVISION}")
-        set(GLFW_VERSION_STRING "${GLFW_VERSION}")
-        mark_as_advanced(GLFW_VERSION)
-    endif()
-
 endif(GLFW_INCLUDE_DIR)

 include(FindPackageHandleStandardArgs)


Update CMakeExternals.cmake

Update CMakeExternals.cmake

imgui can now be used by more than one plugin

--- CMakeExternals.cmake
+++ CMakeExternals.cmake
@@ -246,28 +246,27 @@

   # imgui
   elseif(NAME STREQUAL "imgui")
-    if(TARGET imgui)
-      return()
-    endif()
-
-    if(WIN32)
-      set(IMGUI_LIB "lib/imgui.lib")
-    else()
-      set(IMGUI_LIB "lib/libimgui.a")
-    endif()
-
-    add_external_project(imgui STATIC
-      GIT_REPOSITORY https://github.com/ocornut/imgui.git
-      GIT_TAG "v1.70"
-      BUILD_BYPRODUCTS "<INSTALL_DIR>/${IMGUI_LIB}"
-      PATCH_COMMAND ${CMAKE_COMMAND} -E copy
-        "${CMAKE_SOURCE_DIR}/cmake/imgui/CMakeLists.txt"
-        "<SOURCE_DIR>/CMakeLists.txt")
+    if(NOT TARGET imgui)
+
+      if(WIN32)
+        set(IMGUI_LIB "lib/imgui.lib")
+      else()
+        set(IMGUI_LIB "lib/libimgui.a")
+      endif()
+
+      add_external_project(imgui STATIC
+        GIT_REPOSITORY https://github.com/ocornut/imgui.git
+        GIT_TAG "v1.70"
+        BUILD_BYPRODUCTS "<INSTALL_DIR>/${IMGUI_LIB}"
+        PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+          "${CMAKE_SOURCE_DIR}/cmake/imgui/CMakeLists.txt"
+          "<SOURCE_DIR>/CMakeLists.txt")
+
+      add_external_library(imgui
+      LIBRARY ${IMGUI_LIB})
+    endif()

     external_get_property(imgui SOURCE_DIR)
-
-    add_external_library(imgui
-      LIBRARY ${IMGUI_LIB})

     target_include_directories(imgui INTERFACE "${SOURCE_DIR}/examples" "${SOURCE_DIR}/misc/cpp")


BUG: ITKIOMINC DEPENDS on ITKMINC

BUG: ITKIOMINC DEPENDS on ITKMINC

itkMINCImageIO.h requires the itk_minc2.h header from the ITKMINC module.

Fixes build of the following project:

  CMakeList.txt:

    cmake_minimum_required(VERSION 3.0)

    find_package(ITK REQUIRED COMPONENTS ITKIOMINC)
    include(${ITK_USE_FILE})

    add_executable(minctest test.cxx)

  test.cxx:

    #include "itkMINCImageIO.h"

    int main()
    {
      return 0;
    }

Change-Id: I992247925f6616df102ea8270bdaf491fd66b9d4

--- Modules/IO/MINC/itk-module.cmake
+++ Modules/IO/MINC/itk-module.cmake
@@ -5,11 +5,9 @@
   ENABLE_SHARED
   DEPENDS
     ITKIOImageBase
-  PRIVATE_DEPENDS
     ITKMINC
   TEST_DEPENDS
     ITKTestKernel
-    ITKMINC
     ITKImageStatistics
   DESCRIPTION
     "${DOCUMENTATION}"


update CTestConfig file for my.cdash.org

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -3,11 +3,11 @@
 ## project to incorporate the testing dashboard.
 ## # The following are required to uses Dart and the Cdash dashboard
 ##   ENABLE_TESTING()
-##   INCLUDE(Dart)
+##   INCLUDE(CTest)
 set(CTEST_PROJECT_NAME "Eigen")
 set(CTEST_NIGHTLY_START_TIME "05:00:00 UTC")

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


Test related stuff.

Test related stuff.

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -1,4 +1,5 @@
 IF(WIN32)
-#    SET(CTEST_CUSTOM_POST_TEST "type Testing/Temporary/LastTest.log")
-    SET(CTEST_CUSTOM_POST_TEST "cd")
+    SET(CTEST_CUSTOM_POST_TEST
+      "C:\Windows\System32\cmd /C type Testing\Temporary\LastTest.log")
+#    SET(CTEST_CUSTOM_POST_TEST "type Testing\Temporary\LastTest.log")
 ENDIF(WIN32)


Make cppcheck tests work when there are no other tests

--- CommonCTest.cmake
+++ CommonCTest.cmake
@@ -33,7 +33,8 @@

 add_custom_target(runtests
   COMMAND ${CMAKE_CTEST_COMMAND} \${ARGS} DEPENDS ${ALL_TESTS}
-  COMMENT "Running all unit tests")
+  COMMENT "Running all unit tests"
+  WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")

 if(COVERAGE)
   add_custom_target(lcov-gather


fixes issue 1024

fixes issue 1024

Kill infloop.exe by pid instead of name to support simultanous nudge tests
(an alternative would be to add an ordering dependence, but we already bail
earlier if we can't get the pid, so we always have it).

git-svn-id: fe3cd4388a6e5a968b09397a3d721fe124e8117a@1033 5b54908e-ead4-fc18-b48a-0285e6dbc711

--- tests/runtest.cmake
+++ tests/runtest.cmake
@@ -104,6 +104,7 @@
 # select(undef, undef, undef, X) sleeps for X seconds where X can be non-int.
 set(SLEEP_SHORT ${PERL} -e "select(undef, undef, undef, 0.1)")
 set(TIMEOUT_SHORT "100")  # *0.1 = 10 seconds
+set(TIMEOUT_SHORT_APP "200")  # *0.1 = 20 seconds
 set(SLEEP_LONG ${PERL} -e "select(undef, undef, undef, 2)")
 set(TIMEOUT_APP "120")

@@ -158,7 +159,7 @@
     execute_process(COMMAND ${SLEEP_SHORT})
     file(READ "${out}" output)
     math(EXPR iters "${iters} + 1")
-    if ("${iters}" STREQUAL "${TIMEOUT_SHORT}")
+    if ("${iters}" STREQUAL "${TIMEOUT_SHORT_APP}")
       message(FATAL_ERROR "Timed out waiting for app to start")
     endif ()
   endwhile()
@@ -253,7 +254,8 @@
     # combine out and err
     set(kill_err "${kill_out}${kill_err}")
   else (UNIX)
-    execute_process(COMMAND "${toolbindir}/DRkill.exe" -exe "${exename}"
+    # we can't kill by name b/c we have multiple tests using infloop.exe (i#1024)
+    execute_process(COMMAND "${toolbindir}/DRkill.exe" -pid "${pid}"
       RESULT_VARIABLE kill_result
       ERROR_VARIABLE kill_err
       OUTPUT_QUIET) # prints "killing process ..."


Updated jenkins cmake script

Updated jenkins cmake script

--- CTestJenkins.cmake
+++ CTestJenkins.cmake
@@ -8,7 +8,7 @@
 set(CTEST_BUILD_OPTIONS "${JENKINS_BUILD_OPTIONS}")
 set(CTEST_BUILD_CONFIGURATION "${JENKINS_BUILD_CONFIGURATION}")

-set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--xml=yes --xml-file=test_memcheck.xml")
+set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--xml=yes --xml-file=\"${CTEST_BINARY_DIRECTORY}/test_%p_memcheck.xml\"")

 set(CTEST_COVERAGE_CXX_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-fprofile-arcs -ftest-coverage")
 set(CTEST_COVERAGE_EXE_LD_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=-fprofile-arcs -ftest-coverage")


Remove extra quotes around package ID #6828

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -273,7 +273,7 @@
 add_definitions( -DCONDOR_VERSION="${VERSION}" )

 if(PACKAGEID)
-  add_definitions( -DPACKAGEID="${PACKAGEID}" )
+  add_definitions( -DPACKAGEID=${PACKAGEID} )
 endif(PACKAGEID)

 if( NOT BUILD_DATE )


Allow CUDNN_LIBNAME to be specified by environment variable

--- chainerx_cc/cmake/FindCuDNN.cmake
+++ chainerx_cc/cmake/FindCuDNN.cmake
@@ -28,10 +28,19 @@
     PATH_SUFFIXES cuda/include include)
 endif()

-if(DEFINED ENV{USE_STATIC_CUDNN})
+if(DEFINED ENV{CUDNN_LIB_DIR})
+  set(CUDNN_LIB_DIR $ENV{CUDNN_LIB_DIR})
+endif()
+
+if(DEFINED ENV{CUDNN_LIBNAME})
+  # libname from envvar
+  set(CUDNN_LIBNAME $ENV{CUDNN_LIBNAME})
+elseif(DEFINED ENV{USE_STATIC_CUDNN})
+  # Static library
   MESSAGE(STATUS "USE_STATIC_CUDNN detected. Linking against static CUDNN library")
   set(CUDNN_LIBNAME "libcudnn_static.a")
 else()
+  # Dynamic library
   set(CUDNN_LIBNAME "cudnn")
 endif()


Working on detecting hdf5 from modules

Working on detecting hdf5 from modules

Former-commit-id: d1445f1fe435b62b22cb6f3f47373ff9b78a859d

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -29,27 +29,24 @@
 endif()

 set(HDF5_ROOT ${HDF5_ROOT} $ENV{ROOT} $ENV{HOME}/.conda $ENV{HOME}/anaconda3 $ENV{HOME}/miniconda3)
+find_file(HDF5_C_COMPILER_EXECUTABLE        NAMES h5cc  PATHS $ENV{PATH} /usr/bin /usr/local/bin $ENV{HOME}/.conda/bin  $ENV{HOME}/anaconda3/bin)
+find_file(HDF5_CXX_COMPILER_EXECUTABLE      NAMES h5c++ PATHS $ENV{PATH} /usr/bin /usr/local/bin $ENV{HOME}/.conda/bin  $ENV{HOME}/anaconda3/bin)

-#find_package(HDF5 ${HDF5_WANT_VERSION} COMPONENTS C HL PATHS ${HDF5_ROOT} $ENV{ROOT} $ENV{HOME}/.conda $ENV{HOME}/anaconda3)
-if(NOT HDF5_FOUND)
-find_file(HDF5_C_COMPILER_EXECUTABLE        NAMES h5cc  PATHS $ENV{PATH} /usr/bin /usr/local/bin $ENV{HOME}/.conda/bin  $ENV{HOME}/anaconda3/bin)
-find_file(HDF5_CXX_COMPILER_EXECUTABLE      NAMES h5c++ PATHS $ENV{PATH} /usr/bin /usr/local/bin $ENV{HOME}/.conda/bin  $ENV{HOME}/anaconda3/bin)
 if(HDF5_REQUIRED)
     find_package(HDF5 ${HDF5_WANT_VERSION} COMPONENTS C HL REQUIRED)
 else()
     find_package(HDF5 ${HDF5_WANT_VERSION} COMPONENTS C HL)
 endif()
-endif()

 # To print all variables, use the code below:
 ##
-#get_cmake_property(_variableNames VARIABLES)
-#foreach (_variableName ${_variableNames})
-#    if("${_variableName}" MATCHES "HDF5" OR "${_variableName}" MATCHES "hdf5" OR "${_variableName}" MATCHES "h5")
-#        message(STATUS "${_variableName}=${${_variableName}}")
-#    endif()
-#endforeach()
+get_cmake_property(_variableNames VARIABLES)
+foreach (_variableName ${_variableNames})
+    if("${_variableName}" MATCHES "HDF5" OR "${_variableName}" MATCHES "hdf5" OR "${_variableName}" MATCHES "h5")
+        message(STATUS "${_variableName}=${${_variableName}}")
+    endif()
+endforeach()

 if(HDF5_FOUND)


Find Hinnant date library in date/ subfolder

--- cmake/Modules/FindHinnantDate.cmake
+++ cmake/Modules/FindHinnantDate.cmake
@@ -53,7 +53,7 @@
 Maybe you need to adjust the search paths or HinnantDate_ROOT_DIR.")

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


Fix ant/Java detection in cmake scripts

Fix ant/Java detection in cmake scripts

Mac OS X 10.7 and newer don't come with Java installed. They do
include some stub binaries, which ask the user if they want to
install Java when run.

OpenCV's cmake script just checks for the existence of an ant
binary and assumes that Java's available if ant is. As a result,
cmake will configure the build to use Java and it will fail once
it tries to compile the Java bindings.

This fixes the issue by checking for the exit status of
`ant -version` - it exits 0 if Java is installed, or 1
otherwise.

--- cmake/OpenCVDetectApacheAnt.cmake
+++ cmake/OpenCVDetectApacheAnt.cmake
@@ -16,10 +16,16 @@

 if(ANT_EXECUTABLE)
   execute_process(COMMAND ${ANT_EXECUTABLE} -version
+    RESULT_VARIABLE ANT_ERROR_LEVEL
     OUTPUT_VARIABLE ANT_VERSION_FULL
     OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" ANT_VERSION "${ANT_VERSION_FULL}")
-  set(ANT_VERSION "${ANT_VERSION}" CACHE INTERNAL "Detected ant vesion")
+  if (ANT_ERROR_LEVEL)
+    unset(ANT_EXECUTABLE)
+    unset(ANT_EXECUTABLE CACHE)
+  else()
+    string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" ANT_VERSION "${ANT_VERSION_FULL}")
+    set(ANT_VERSION "${ANT_VERSION}" CACHE INTERNAL "Detected ant vesion")

-  message(STATUS "Found apache ant ${ANT_VERSION}: ${ANT_EXECUTABLE}")
+    message(STATUS "Found apache ant ${ANT_VERSION}: ${ANT_EXECUTABLE}")
+  endif()
 endif()


Changed policy CMP0022 (CMake) to avoid configuration warnings for versions > 2.8.12

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -4,7 +4,9 @@
 cmake_policy(SET CMP0003 NEW) # See "cmake --help-policy CMP0003" for more details
 cmake_policy(SET CMP0011 NEW) # See "cmake --help-policy CMP0011" for more details
 cmake_policy(SET CMP0009 NEW) # See "cmake --help-policy CMP0009" for more details
-cmake_policy(SET CMP0022 OLD) # See "cmake --help-policy CMP0022" for more details
+if(CMAKE_VERSION VERSION_GREATER 2.8.12)
+  cmake_policy(SET CMP0022 OLD) # See "cmake --help-policy CMP0022" for more details
+endif()

 set(lib lib)
 set(bin bin)


Revert "Do not run the benchmarks as part of the pull request checks."

This reverts commit b54ee2779902c73d6f035e743634efa41f14e122.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -1245,7 +1245,7 @@
   ROOT_ADD_TEST(gbench${mangled_name}
     COMMAND ${benchmark}
     WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR}
-    LABELS "benchmark;longtest")
+    LABELS "benchmark")
 endfunction()

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


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/gloox/hunter.cmake
+++ cmake/projects/gloox/hunter.cmake
@@ -5,6 +5,17 @@
 include(hunter_pick_scheme)

 # List of versions here...
+
+hunter_add_version(
+    PACKAGE_NAME
+    gloox
+    VERSION
+    "1.0.20-p3"
+    URL
+    "https://github.com/designerror/gloox/archive/v1.0.20-p3.tar.gz"
+    SHA1
+    b9ec5504eb107681a198d2531bddc7b80662bf9e
+)

 hunter_add_version(
     PACKAGE_NAME


Checking if ceres crashes because of Eigen

Former-commit-id: b1ad41b0e1121d854211954897c0d7b2d82b15c3

--- cmake-modules/Fetch_Eigen3.cmake
+++ cmake-modules/Fetch_Eigen3.cmake
@@ -34,16 +34,19 @@

 if(TARGET Eigen3::Eigen AND TARGET blas )
     set(EIGEN3_USING_BLAS ON)
-    if(TARGET mkl)
-        message(STATUS "Eigen3 will use MKL")
-        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_MKL_ALL)
-        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_LAPACKE_STRICT)
-        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_MKL_ALL)
-        target_include_directories(Eigen3::Eigen INTERFACE ${MKL_INCLUDE_DIR})
-    else ()
-        message(STATUS "Eigen3 will use BLAS and LAPACKE")
-        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_BLAS)
-        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_LAPACKE_STRICT)
-    endif()
+#    if(TARGET mkl)
+#        message(STATUS "Eigen3 will use MKL")
+#        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_MKL_ALL)
+#        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_LAPACKE_STRICT)
+#        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_MKL_ALL)
+#        target_include_directories(Eigen3::Eigen INTERFACE ${MKL_INCLUDE_DIR})
+#    else ()
+#        message(STATUS "Eigen3 will use BLAS and LAPACKE")
+#        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_BLAS)
+#        target_compile_definitions    (Eigen3::Eigen INTERFACE -DEIGEN_USE_LAPACKE_STRICT)
+#    endif()
+
+    target_compile_definitions(Eigen3::Eigen INTERFACE -DEIGEN_DONT_ALIGN_STATICALLY)
+    target_compile_definitions(Eigen3::Eigen INTERFACE -DEIGEN_DONT_VECTORIZE)
 endif()


[CMake] Don't trust compiler error code, also check for errors

Summary: rnk reported that MSVC ignores unknown flags and still returns 0. This should cause unknown flags to be an error during the compiler check.

Reviewers: rnk

Subscribers: brad.king, llvm-commits

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

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@277377 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/BuiltinTests.cmake
+++ cmake/Modules/BuiltinTests.cmake
@@ -1,3 +1,4 @@
+include(CMakeCheckCompilerFlagCommonPatterns)

 # This function takes an OS and a list of architectures and identifies the
 # subset of the architectures list that the installed toolchain can target.
@@ -37,7 +38,18 @@
     OUTPUT_VARIABLE TEST_OUTPUT
     ERROR_VARIABLE TEST_ERROR
   )
-  if(result EQUAL 0)
+
+  CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCCompilerFlag_COMMON_PATTERNS)
+  foreach(var ${_CheckCCompilerFlag_COMMON_PATTERNS})
+    if("${var}" STREQUAL "FAIL_REGEX")
+      continue()
+    endif()
+    if("${var}" MATCHES "${_CheckCCompilerFlag_COMMON_PATTERNS}")
+      set(ERRORS_FOUND True)
+    endif()
+  endforeach()
+
+  if(result EQUAL 0 AND NOT ERRORS_FOUND)
     set(${output} True PARENT_SCOPE)
   else()
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log


revert CMINPACK_IS_STATIC cmake option for windows

non patched CMinpack cmake script doesn't add _s suffix when cminpack is static

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@2047 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindCMinpack.cmake
+++ cmake/Modules/FindCMinpack.cmake
@@ -62,8 +62,13 @@
   message(STATUS "CMinPack found (include: ${CMINPACK_INCLUDE_DIRS}, libs: ${CMINPACK_LIBRARIES})")
   if(WIN32)
     get_filename_component(cminpack_lib ${CMINPACK_LIBRARY} NAME_WE)
+    set(CMINPACK_IS_STATIC_DEFAULT OFF)
     if("${cminpack_lib}" STREQUAL "cminpack_s")
+      set(CMINPACK_IS_STATIC_DEFAULT ON)
+    endif("${cminpack_lib}" STREQUAL "cminpack_s")
+    option(CMINPACK_IS_STATIC "Set to OFF if you use shared cminpack library." ${CMINPACK_IS_STATIC_DEFAULT})
+    if(CMINPACK_IS_STATIC)
       add_definitions(-DCMINPACK_NO_DLL)
-    endif("${cminpack_lib}" STREQUAL "cminpack_s")
+    endif(CMINPACK_IS_STATIC)
   endif(WIN32)
 endif(CMINPACK_FOUND)


Add Boost.Test to the list of TPLs

Add Boost.Test to the list of TPLs

--- cmake/TPLs/FindTPLBoostOrg.cmake
+++ cmake/TPLs/FindTPLBoostOrg.cmake
@@ -10,7 +10,9 @@
                    boost/geometry.hpp
                    boost/range.hpp
                    boost/program_options.hpp
+                   boost/test/unit_test.hpp
   REQUIRED_LIBS_NAMES boost_program_options
+                      boost_unit_test_framework
   )

 # Use CMake FindBoost module to check version is sufficient


Add cmake warning if a device is enabled which has been disabled by default either because it is deprecated or is buggy.

svn path=/trunk/; revision=12115

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -260,4 +260,10 @@
   #message(STATUS "DEBUG: DEVICE = ${DEVICE}")
   #message(STATUS "DEBUG: DEFAULT= ${DEFAULT}")
   option(PLD_${DEVICE} "Enable ${DEVICE} device" ${DEFAULT})
+  if(PLD_${DEVICE} AND NOT ${DEFAULT})
+    message(STATUS
+      "WARNING: You have enabled the PLD_${DEVICE} device which is disabled by "
+      "default either because it is deprecated, or because there are know issues "
+      "with it. Please check the documentation / release notes for details.")
+  endif(PLD_${DEVICE} AND NOT ${DEFAULT})
 endforeach(DRIVERS_DEVICE)


Fix findleap

Fix findleap

--- CMake/FindLeap.cmake
+++ CMake/FindLeap.cmake
@@ -1,7 +1,7 @@
 FIND_PATH(Leap_INCLUDE_DIRS NAMES "Leap.h" "LeapMath.h" PATHS ENV Leap_INCLUDE_DIR DOC "The Leap motion SDK include directory")
 message("Leap_INCLUDE_DIRS: ${Leap_INCLUDE_DIRS}; Leap_LIBRARIES: ${Leap_LIBRARIES}")
 message("PREFIX: ${CMAKE_PREFIX_PATH}")
-FIND_LIBRARY(Leap_LIBRARIES NAMES Leap PATHS /usr/lib/Leap /lib/Leap /opt/Leap/ ${CMAKE_PREFIX_PATH}/Leap ENV Leap_LIB_DIR DOC "The Leap motion library (libLeap.so)")
+FIND_LIBRARY(Leap_LIBRARIES NAMES Leap PATHS /usr/lib32/Leap /lib32/Leap /usr/lib/Leap /lib/Leap /opt/Leap/ ${CMAKE_PREFIX_PATH}/Leap ENV Leap_LIB_DIR DOC "The Leap motion library (libLeap.so)")

 SET(Leap_FOUND FALSE)


Update to latest Plugin.cmake from cmake-modules

--- cmake/Plugin.cmake
+++ cmake/Plugin.cmake
@@ -9,11 +9,13 @@
   endif()

   if(CMAKE_COMPILER_IS_GNUCXX)
-    target_compile_options(${name} PRIVATE -Wno-attributes)
+    set_property(TARGET ${name} APPEND_STRING PROPERTY
+                 COMPILE_FLAGS " -Wno-attributes")
   endif()

   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-    target_compile_options(${name} PRIVATE -Wno-ignored-attributes)
+    set_property(TARGET ${name} APPEND_STRING PROPERTY
+                 COMPILE_FLAGS " -Wno-ignored-attributes")
   endif()

   if(WIN32 AND CMAKE_COMPILER_IS_GNUCC)


Fix the assimp linking error

Fix the assimp linking error

--- cmake/assimp.cmake
+++ cmake/assimp.cmake
@@ -43,12 +43,9 @@

 	# Set libassimp properties
 	set_target_properties(libassimp PROPERTIES
-	  "IMPORTED_IMPLIB" "${binary_dir}/${CMAKE_CFG_INTDIR}/assimp.lib"
+	  "IMPORTED_IMPLIB" "${binary_dir}/code/${CMAKE_CFG_INTDIR}/assimp${LIBRARY_SUFFIX}.lib"
 	)
 	include_directories("${source_dir}/include")

-	MESSAGE(STATUS "${source_dir}/include")
-	MESSAGE(STATUS "${binary_dir}/code/${CMAKE_CFG_INTDIR}/assimp${LIBRARY_SUFFIX}.lib")
-
 	set(ASSIMP_CONFIGURED TRUE)
 endif()


Remove Clang warnings when building Lua

Remove Clang warnings when building Lua

When building Lua, Clang gives warnings about an empty loop body
and a few deprecated declarations.  This submissions adds the
-Wno-empty-body and -Wno-deprecated-declaration flags to the compiler
line to supress thos warnings.

Change-Id: I9100a65d74987c1ccd4bc950087bcc25cd4120f0

--- SuperBuild/lua.cmake
+++ SuperBuild/lua.cmake
@@ -1,4 +1,10 @@
 cmake_minimum_required ( VERSION 2.8.1 FATAL_ERROR )
+
+
+if(POLICY CMP0025)
+  cmake_policy(SET CMP0025 OLD)
+endif()
+

 project (LUA C)

@@ -41,6 +47,12 @@
   SET( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} /wd4334" )
 endif()

+if( APPLE )
+  if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+    # suppress Clang warnings about empty loop bodies and deprecated declarations (tmpnam)
+    SET( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Wno-empty-body -Wno-deprecated-declarations" )
+  endif()
+endif()

 # define the lua core source files
 set (LUA_CORE_SRCS src/lapi.c src/lcode.c src/ldebug.c src/ldo.c src/ldump.c


CELIX-401: Removes incorrect add_dependencies usage in the add_celix_docker CMake command

--- cmake/cmake_celix/DockerPackaging.cmake
+++ cmake/cmake_celix/DockerPackaging.cmake
@@ -221,7 +221,6 @@
                 COMMENT "Copying bundle '${BUNDLE}' to '${OUT}'"
                 DEPENDS ${BUNDLE}
             )
-            add_dependencies(${DOCKER_TARGET} ${OUT})
         else() #assuming target
             get_target_property(BFN ${BUNDLE} BUNDLE_FILE_NAME)
             list(APPEND BUNDLES "${BUNDLES_DIR}/${BFN}")


cmake: fix use of unsupported -fno-pie with xcc

The commit 8259931fce1b ("xcc-clang: Do not used unavailable options")
has a side-effect that builds with xcc default to use -fno-pie. This
is not a supported compiler option for xcc, resulting in failing builds.

Use same configuration for xcc as is in place for xcc-clang, and
do not use -fno-pie.

Signed-off-by: Kai Vehmanen <7c1f7969959c2510655bc0fc9c602f735b2254b7@linux.intel.com>

--- cmake/compiler/xcc/compiler_flags.cmake
+++ cmake/compiler/xcc/compiler_flags.cmake
@@ -9,3 +9,6 @@
 check_set_compiler_property(APPEND PROPERTY warning_base "-fgnu89-inline")

 set_compiler_property(PROPERTY warning_error_misra_sane)
+
+# XCC does not support -fno-pic and -fno-pie
+set_compiler_property(PROPERTY no_position_independent "")


Fix incorrect indentation

Fix incorrect indentation

--- cmake/configs/posix_bebop_default.cmake
+++ cmake/configs/posix_bebop_default.cmake
@@ -100,6 +100,6 @@
 )

 set(config_df_driver_list
-  ms5607
-  mpu6050
+	ms5607
+	mpu6050
 )


Fix copy paste error in breakpad module

Fix copy paste error in breakpad module

--- cmake/modules/BuildGoogleBreakpad.cmake
+++ cmake/modules/BuildGoogleBreakpad.cmake
@@ -110,9 +110,9 @@
 if(WIN32 AND NOT MINGW)
   set(BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR ${BREAKPAD_EXCEPTION_HANDLER_INSTALL_DIR}/include/breakpad)

-  set(BREAKPAD_COMMON_LIBRARY_DIR "${BREAKPAD_EXCEPTION_HANDLER_LIBRARY_DIR}/breakpad/client/windows/$<CONFIG>/lib")
-  set(BREAKPAD_CRASH_CLIENT_LIBRARY_DIR "${BREAKPAD_EXCEPTION_HANDLER_LIBRARY_DIR}/breakpad/client/windows/crash_generation/$<CONFIG>/lib")
-  set(BREAKPAD_EXCEPTION_HANDLER_LIBRARY_DIR "${BREAKPAD_EXCEPTION_HANDLER_LIBRARY_DIR}/breakpad/client/windows/handler/$<CONFIG>/lib")
+  set(BREAKPAD_COMMON_LIBRARY_DIR "${BREAKPAD_EXCEPTION_HANDLER_INSTALL_DIR}/breakpad/client/windows/$<CONFIG>/lib")
+  set(BREAKPAD_CRASH_CLIENT_LIBRARY_DIR "${BREAKPAD_EXCEPTION_HANDLER_INSTALL_DIR}/breakpad/client/windows/crash_generation/$<CONFIG>/lib")
+  set(BREAKPAD_EXCEPTION_HANDLER_LIBRARY_DIR "${BREAKPAD_EXCEPTION_HANDLER_INSTALL_DIR}/breakpad/client/windows/handler/$<CONFIG>/lib")
   set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES
     "${BREAKPAD_COMMON_LIBRARY_DIR}/common.lib"
     "${BREAKPAD_EXCEPTION_HANDLER_LIBRARY_DIR}/exception_handler.lib"


ORC-679: Update tzdata to recover Win32 build in AppVeyor (#558)

### What changes were proposed in this pull request?

This PR aims to update tzdata to recover Win32 build in AppVeyor.

### Why are the changes needed?

Currently, AppVeyor builds on `master/branch-1.6/branch-1.5` are broken since Oct 9, 2020. To recover CI test coverage.

### How was this patch tested?

Pass the AppVeyor.

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -259,8 +259,8 @@

 if (WIN32)
   ExternalProject_Add(tzdata_ep
-    URL "ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/tzdata-2019b-1.tar.xz"
-    URL_HASH MD5=17D8AB346BB1009D4EB35BC08040E51D
+    URL "ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/tzdata-2020b-1.tar.xz"
+    URL_HASH MD5=1BE1D18B4042A5011E96D20054BEEF33
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
     INSTALL_COMMAND "")


update openssl to 1.1.1g

update openssl to 1.1.1g

--- deps/openssl.cmake
+++ deps/openssl.cmake
@@ -30,8 +30,8 @@

   ExternalProject_Add(openssl
       PREFIX            openssl
-      URL               https://www.openssl.org/source/openssl-1.1.1d.tar.gz
-      URL_HASH          SHA256=1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
+      URL               https://www.openssl.org/source/openssl-1.1.1g.tar.gz
+      URL_HASH          SHA256=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46
       LOG_BUILD         ON
       BUILD_IN_SOURCE   YES
       BUILD_COMMAND     ${OPENSSL_BUILD_COMMAND}


Revert accidental deoptimisation.

Revert accidental deoptimisation.

--- build_settings.cmake
+++ build_settings.cmake
@@ -67,7 +67,7 @@
 endif()

 # C and C++ compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} -DXXH_INLINE_ALL -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} ${EXTRA_C_FLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} -DXXH_INLINE_ALL -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} ${EXTRA_C_FLAGS}")
 # AddressSanitizer/ThreadSanitizer work for both GCC and Clang
 if (VESPA_USE_SANITIZER)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${VESPA_USE_SANITIZER}")


CMake: Don't forget to guard librt as well

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

--- deal.II/cmake/modules/FindUMFPACK.cmake
+++ deal.II/cmake/modules/FindUMFPACK.cmake
@@ -146,10 +146,12 @@
   # lib does not record its dependence on librt.so as evidenced
   # by ldd :-( ):
   #
-  FIND_LIBRARY(rt_lib NAMES rt)
-  MARK_AS_ADVANCED(rt_lib)
-  IF(NOT rt_lib MATCHES "-NOTFOUND")
-    LIST(APPEND UMFPACK_LIBRARIES ${rt_lib})
+  SWITCH_LIBRARY_PREFERENCE()
+  FIND_LIBRARY(rt_LIBRARY NAMES rt)
+  SWITCH_LIBRARY_PREFERENCE()
+  MARK_AS_ADVANCED(rt_LIBRARY)
+  IF(NOT rt_LIBRARY MATCHES "-NOTFOUND")
+    LIST(APPEND UMFPACK_LIBRARIES ${rt_LIBRARY})
   ENDIF()

   SET(UMFPACK_INCLUDE_DIRS


update external dependency git sha1 references

this updates externals ctkPythonConsole, QtPropertyBrowser,
and vtk to grab windows related build fixes.

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -136,8 +136,8 @@
 ###############################################################################
 # ctkPythonConsole
 ExternalProject_Add(ctkPythonConsole
-  GIT_REPOSITORY http://github.com/patmarion/ctkPythonConsole
-  GIT_TAG b24d917ad
+  GIT_REPOSITORY https://github.com/patmarion/ctkPythonConsole
+  GIT_TAG 15988c5
   CMAKE_CACHE_ARGS
     ${default_cmake_args}
     ${qt_args}
@@ -150,7 +150,7 @@
 # QtPropertyBrowser
 ExternalProject_Add(QtPropertyBrowser
   GIT_REPOSITORY https://github.com/patmarion/QtPropertyBrowser
-  GIT_TAG 02671ee
+  GIT_TAG baf10af
   CMAKE_CACHE_ARGS
     ${default_cmake_args}
     ${qt_args}
@@ -160,16 +160,12 @@
 ###############################################################################
 # vtk
 set(use_system_vtk_default ON)
-#if(APPLE)
-#  set(use_system_vtk_default ON)
-#endif()
-
 option(USE_SYSTEM_VTK "Use system version of VTK.  If off, VTK will be built." ${use_system_vtk_default})

 if(NOT USE_SYSTEM_VTK)
   ExternalProject_Add(vtk
-    GIT_REPOSITORY http://vtk.org/VTK.git
-    GIT_TAG v5.10.1
+    GIT_REPOSITORY https://github.com/bilke/VTK.git
+    GIT_TAG b753b7f # vtk 5.10 with fixes for Visual Studio 2013
     CMAKE_CACHE_ARGS
       ${default_cmake_args}
       ${python_args}
@@ -330,5 +326,4 @@
     ctkPythonConsole
     QtPropertyBrowser

-
-  )
+  )


build pcl with c++11

build pcl with c++11

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -362,6 +362,7 @@
       -DBUILD_tools:BOOL=OFF
       -DBUILD_apps:BOOL=OFF
       -DBUILD_visualization:BOOL=OFF
+      -DCMAKE_CXX_FLAGS:STRING=-std=c++11

     DEPENDS
       ${vtk_depends}


cmake arch

cmake arch

--- cmake/LNCommon.cmake
+++ cmake/LNCommon.cmake
@@ -7,6 +7,8 @@

 # Exceprion Backtrace.
 #option(LN_EXCEPTION_BACKTRACE "In some unix environment there is a possibility that can not be compiled." ON)
+
+set(LN_ARCH "x86")	# default

 #------------------------------------------------------------------------------
 # Options
@@ -28,6 +30,14 @@
 				string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
 			endif()
 		endforeach()
+	endif()
+
+	# Architecture.
+	# http://stackoverflow.com/questions/5334095/cmake-multiarchitecture-compilation
+	if (${CMAKE_EXE_LINKER_FLAGS} MATCHES "/machine:x64")	# /machine:x64
+		set(LN_ARCH "x64")
+	else()
+		set(LN_ARCH "x86")
 	endif()
 endif()

@@ -65,35 +75,47 @@

 #------------------------------------------------------------------------------
 function(ln_make_postfix_for_shared_lib outPostfix)
+	set(postfix "")
+
 	if (WIN32)

 		# Architecture.
 		# http://stackoverflow.com/questions/5334095/cmake-multiarchitecture-compilation
-		if (${CMAKE_EXE_LINKER_FLAGS} MATCHES "/machine:x64")	# /machine:x64
-			set(postfix "${postfix}_x64")
-		else()
-			set(postfix "${postfix}_x86")
-		endif()
+		#if (${CMAKE_EXE_LINKER_FLAGS} MATCHES "/machine:x64")	# /machine:x64
+		#	set(postfix "${postfix}_x64")
+		#else()
+		#	set(postfix "${postfix}_x86")
+		#endif()

 		# Unicode.
 		if (${LN_USE_UNICODE_CHAR_SET})
-			set(postfix "${postfix}u")
+			set(postfix "${postfix}U")
 		endif()

 		# MSVC Runtime library.
-		if (LN_MSVC_LINK_MULTI_THREAD_STATIC_RUNTIME)
-			set(postfix "${postfix}MT")
-		else()
-			set(postfix "${postfix}MD")
-		endif()
+		#if (LN_MSVC_LINK_MULTI_THREAD_STATIC_RUNTIME)
+		#	set(postfix "${postfix}MT")
+		#else()
+		#	set(postfix "${postfix}MD")
+		#endif()

 		set(${outPostfix} ${postfix} PARENT_SCOPE)

 	elseif (APPLE)
-		set(${outPostfix} "" PARENT_SCOPE)
+		# Unicode.
+		if (${LN_USE_UNICODE_CHAR_SET})
+			set(postfix "${postfix}U")
+		endif()
+
+		set(${outPostfix} ${postfix} PARENT_SCOPE)

 	elseif (UNIX)
-		set(${outPostfix} "" PARENT_SCOPE)
+		# Unicode.
+		if (${LN_USE_UNICODE_CHAR_SET})
+			set(postfix "${postfix}U")
+		endif()
+
+		set(${outPostfix} ${postfix} PARENT_SCOPE)

 	else()
 		# Not support.


fpta: fix linker gcov's flags for module (minor).

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -297,11 +297,9 @@
     endif()

     add_compile_flags("C;CXX" "-fprofile-arcs" "-ftest-coverage")
-    set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} -fprofile-arcs")
-    set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} -ftest-coverage")
-    set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} -fprofile-arcs")
-    set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} -ftest-coverage")
-
+    set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+    set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+    set(MODULE_LINKER_FLAGS "${MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
     # add_library(gcov SHARED IMPORTED)
   endif()


erthink: cmake: cmake: add CC_HAS_FCXX_EXCEPTIONS/-fcxx-exceptions,-frtti.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -189,6 +189,7 @@
   check_compiler_flag("-Wextra" CC_HAS_WEXTRA)
   check_compiler_flag("-Werror" CC_HAS_WERROR)
   check_compiler_flag("-fexceptions" CC_HAS_FEXCEPTIONS)
+  check_cxx_compiler_flag("-fcxx-exceptions" CC_HAS_FCXX_EXCEPTIONS)
   check_compiler_flag("-funwind-tables" CC_HAS_FUNWIND_TABLES)
   check_compiler_flag("-fno-omit-frame-pointer" CC_HAS_FNO_OMIT_FRAME_POINTER)
   check_compiler_flag("-fno-common" CC_HAS_FNO_COMMON)
@@ -415,6 +416,9 @@

   if(CC_HAS_FEXCEPTIONS)
     add_compile_flags("C;CXX" "-fexceptions")
+  endif()
+  if(CC_HAS_FCXX_EXCEPTIONS)
+    add_compile_flags("CXX" "-fcxx-exceptions -frtti")
   endif()

   # In C a global variable without a storage specifier (static/extern) and


fix cmake parameter

fix cmake parameter

--- cmake/DetectOpenCV.cmake
+++ cmake/DetectOpenCV.cmake
@@ -15,7 +15,7 @@

         # Get parent directory of .pc file
         # GET_PARENT_DIR is a custom macro (may need include(cmake/FileSystemUtils.cmake))
-        GET_PARENT_DIR(OpenCV_DIR_PKG_CONFIG_PATH {${OpenCV_DIR})
+        GET_PARENT_DIR(OpenCV_DIR_PKG_CONFIG_PATH ${OpenCV_DIR})

         message(STATUS "Prepending PKG_CONFIG_PATH with ${OpenCV_DIR_PKG_CONFIG_PATH}")
         set(ENV{PKG_CONFIG_PATH} "${OpenCV_DIR_PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}" )


partially support freertos with armv8-m only in No Trust Zone mode

--- cmake/FindFreeRTOS.cmake
+++ cmake/FindFreeRTOS.cmake
@@ -1,5 +1,5 @@
 # For information about why and how of this file: https://cmake.org/cmake/help/latest/command/find_package.html
-set(FreeRTOS_PORTS ARM_CM0 ARM_CM3 ARM_CM4F ARM_CM7 ARM_CM4_MPU ARM_CM3_MPU ARM_CM7_MPU)
+set(FreeRTOS_PORTS ARM_CM0 ARM_CM3 ARM_CM3_MPU ARM_CM4_MPU ARM_CM4F ARM_CM7 ARM_CM7_MPU ARM_CM23_NTZ ARM_CM33_NTZ)

 if(NOT FreeRTOS_FIND_COMPONENTS)
     set(FreeRTOS_FIND_COMPONENTS ${FreeRTOS_PORTS})
@@ -129,10 +129,12 @@
             NAMES portmacro.h
             PATHS "${FREERTOS_PATH}" "${FREERTOS_PATH}/FreeRTOS"
             PATH_SUFFIXES
+                "portable/GCC/${PORT}"
                 "portable/GCC/${PORT}/r0p1"
-                "portable/GCC/${PORT}"
+                "portable/GCC/${PORT}/non_secure"
                 "Source/portable/GCC/${PORT}"
                 "Source/portable/GCC/${PORT}/r0p1"
+                "Source/portable/GCC/${PORT}/non_secure"
             NO_DEFAULT_PATH
         )


Added fix for building on Debian buster

Added fix for building on Debian buster

--- cmake/FindGTestFix.cmake
+++ cmake/FindGTestFix.cmake
@@ -18,7 +18,7 @@
           OUTPUT_VARIABLE LSB_CODENAME
           OUTPUT_STRIP_TRAILING_WHITESPACE)

-      if(LSB_CODENAME MATCHES stretch)
+      if(LSB_CODENAME MATCHES stretch OR LSB_CODENAME MATCHES buster)
         set(GTEST_SOURCE_DIR /usr/src/googletest/googletest)
       elseif(LSB_CODENAME MATCHES jessie OR LSB_CODENAME MATCHES xenial OR LSB_CODENAME MATCHES bionic)
         set(GTEST_SOURCE_DIR /usr/src/gtest)


Perform the git pull on aiur dashboard runs

--- cmake/aiur_nightly.cmake
+++ cmake/aiur_nightly.cmake
@@ -13,6 +13,7 @@
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")

 ctest_start("Nightly")
+ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY})
 ctest_configure()
 ctest_build()
 ctest_test(PARALLEL_LEVEL 3 RETURN_VALUE res)


Added target generation fpr subprojects

Added target generation fpr subprojects

--- cmake/clang-format.cmake
+++ cmake/clang-format.cmake
@@ -16,18 +16,19 @@
     endforeach ()
 endforeach ()

-add_custom_target(clangformat
-    COMMENT "Running clang-format to change files"
-    COMMAND ${CLANG_FORMAT_BIN} -i ${ALL_SOURCE_FILES}
-)
+set(FORMAT_TARGET_NAME format)
+if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
+	set(FORMAT_TARGET_NAME format-${PROJECT_NAME})
+endif()

-add_custom_target(format
+add_custom_target(${FORMAT_TARGET_NAME}
     COMMENT "Running clang-format to change files"
     COMMAND ${CLANG_FORMAT_BIN} -style=file -i ${ALL_SOURCE_FILES}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 )

-add_custom_target(format-check
+add_custom_target(${FORMAT_TARGET_NAME}-check
     COMMENT "Checking clang-format changes"
     # Use ! to negate the result for correct output
     COMMAND !


CMake: really avoid target_include_directories

--- cmake/fastd_module.cmake
+++ cmake/fastd_module.cmake
@@ -28,7 +28,7 @@
   _fastd_module_handle_name()

   if(WITH_${TYPE}_${NAME})
-    target_include_directories(${type}_${name_} PRIVATE ${ARGN})
+    set_property(TARGET ${type}_${name_} APPEND PROPERTY INCLUDE_DIRECTORIES ${ARGN})
   endif(WITH_${TYPE}_${NAME})
 endfunction(fastd_module_include_directories)


Stylistic changes including replacing some MATCHES logic that can be done
a simpler way.

Avoid setting java variables when jni.h not found.

svn path=/trunk/; revision=7101

--- cmake/modules/java.cmake
+++ cmake/modules/java.cmake
@@ -22,7 +22,7 @@
 # Module for determining Java bindings configuration options

 # Options to enable Java bindings
-OPTION(ENABLE_java "Enable Java bindings" ON)
+option(ENABLE_java "Enable Java bindings" ON)

 if(ENABLE_java AND NOT BUILD_SHARED_LIBS)
   message(STATUS "WARNING: "
@@ -36,50 +36,43 @@
   set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
 endif(ENABLE_java AND NOT SWIG_FOUND)

-IF (ENABLE_java)
+if(ENABLE_java)
+  # Check for java compiler
+  include(CMakeDetermineJavaCompiler)
+  if(NOT CMAKE_Java_COMPILER)
+    message(STATUS "WARNING: "
+      "java compiler not found. Disabling java bindings")
+    set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
+  endif(NOT CMAKE_Java_COMPILER)
+endif(ENABLE_java)

-# Check for java compiler
-INCLUDE(CMakeDetermineJavaCompiler)
+if(ENABLE_java)
+  # Check for java environment
+  enable_language(Java)
+  find_package(JNI)
+  # If CMake doesn't find jni.h you need set CMAKE_INCLUDE_PATH
+  if(NOT JAVA_INCLUDE_PATH)
+    message(STATUS
+      "WARNING: jni.h header not found. Disabling Java bindings.\n"
+    "   Please install that header and/or set the environment variable\n"
+    "   CMAKE_INCLUDE_PATH appropriately."
+    )
+    set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
+  endif(NOT JAVA_INCLUDE_PATH)
+endif(ENABLE_java)

-IF (CMAKE_Java_COMPILER MATCHES "NOTFOUND$")
-  MESSAGE(STATUS "WARNING: "
-    "java compiler not found. Disabling java bindings")
-  SET(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
-ENDIF (CMAKE_Java_COMPILER MATCHES "NOTFOUND$")
-
-ENDIF (ENABLE_java)
-
-IF (ENABLE_java)
-
-# Check for java environment
-ENABLE_LANGUAGE(Java)
-
-FIND_PACKAGE(JNI)
-
-# If CMake doesn't find jni.h you need set JAVA_INCLUDE_PATH
-IF( "${JAVA_INCLUDE_PATH}" MATCHES "NOTFOUND$" )
-  MESSAGE(STATUS
-      "WARNING: jni.h header not found. Disabling Java bindings.\n"
-  "   Please install that header and/or set the environment variable\n"
-  "   CMAKE_INCLUDE_PATH appropriately."
-  )
-  SET(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
-ENDIF( "${JAVA_INCLUDE_PATH}" MATCHES "NOTFOUND$" )
-
-# Set up installation locations for java specific files.
-# Java .jar files.
-set(JAR_INSTALL_DIR share/java)
-set(JAR_DIR ${CMAKE_INSTALL_PREFIX}/${JAR_INSTALL_DIR})
-get_filename_component(JAVADATA_HARDDIR ${JAR_DIR} ABSOLUTE)
-# JNI .so files.
-SET(JAVAWRAPPER_DIR ${LIB_DIR}/jni)
-GET_FILENAME_COMPONENT(JAVAWRAPPER_HARDDIR ${JAVAWRAPPER_DIR} ABSOLUTE)
-# Library name will be system dependent. For now assume .so
-# We're not currently using libtool so we can't use the autotools
-# trick to guess.
-# This will definitely need changing for windows.
-SET(PLPLOTJAVAC_WRAP_DLL plplotjavac_wrap.so)
-
-ENDIF (ENABLE_java)
-
-
+if(ENABLE_java)
+  # Set up installation locations for java specific files.
+  # Java .jar files.
+  set(JAR_INSTALL_DIR share/java)
+  set(JAR_DIR ${CMAKE_INSTALL_PREFIX}/${JAR_INSTALL_DIR})
+  get_filename_component(JAVADATA_HARDDIR ${JAR_DIR} ABSOLUTE)
+  # JNI .so files.
+  set(JAVAWRAPPER_DIR ${LIB_DIR}/jni)
+  get_filename_component(JAVAWRAPPER_HARDDIR ${JAVAWRAPPER_DIR} ABSOLUTE)
+  # Library name will be system dependent. For now assume .so
+  # We're not currently using libtool so we can't use the autotools
+  # trick to guess.
+  # This will definitely need changing for windows.
+  set(PLPLOTJAVAC_WRAP_DLL plplotjavac_wrap.so)
+endif(ENABLE_java)


added rostime to target_link_libraries

added rostime to target_link_libraries

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@3710 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_ros.cmake
+++ cmake/pcl_find_ros.cmake
@@ -3,7 +3,7 @@

 macro(link_ros_libs _target)
     if(USE_ROS)
-        target_link_libraries(${_target} sensor_msgs roscpp_serialization rosconsole)
+        target_link_libraries(${_target} sensor_msgs roscpp_serialization rosconsole rostime)
     endif(USE_ROS)
 endmacro(link_ros_libs)


Cleanup pcl_find_sse.

Cleanup pcl_find_sse.

Only look for SSE flags when compiler does not support -march=native.
Don't blindly set -march=native for compilers other than APPLE and MSVC.

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@4725 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_sse.cmake
+++ cmake/pcl_find_sse.cmake
@@ -1,133 +1,143 @@
 ###############################################################################
 # Check for the presence of SSE and figure out the flags to use for it.
 macro(PCL_CHECK_FOR_SSE)
-    include(CheckCXXSourceRuns)
     set(SSE_FLAGS)
-    set(CMAKE_REQUIRED_FLAGS)
-
-    check_cxx_source_runs("
-        #include <mm_malloc.h>
-        int main()
-        {
-          void* mem = _mm_malloc (100, 16);
-          return 0;
-        }"
-        HAVE_MM_MALLOC)
-
-    check_cxx_source_runs("
-        #include <stdlib.h>
-        int main()
-        {
-          void* mem;
-          return posix_memalign (&mem, 16, 100);
-        }"
-        HAVE_POSIX_MEMALIGN)

     if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-        set(CMAKE_REQUIRED_FLAGS "-msse4.1")
-    endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+        execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion"
+                        OUTPUT_VARIABLE GCC_VERSION_STRING)
+        if(GCC_VERSION_STRING VERSION_GREATER 4.2 AND NOT APPLE)
+          SET(SSE_FLAGS "${SSE_FLAGS} -march=native")
+          message(STATUS "Using CPU native flags for SSE optimization: ${SSE_FLAGS}")
+        endif()
+    endif()

-    check_cxx_source_runs("
-        #include <smmintrin.h>
-        int main()
-        {
-          __m128 a, b;
-          float vals[4] = {1, 2, 3, 4};
-          const int mask = 123;
-          a = _mm_loadu_ps(vals);
-          b = a;
-          b = _mm_dp_ps (a, a, mask);
-          _mm_storeu_ps(vals,b);
-          return 0;
-        }"
-        HAVE_SSE4_1_EXTENSIONS)
+    if (NOT SSE_FLAGS)
+      include(CheckCXXSourceRuns)
+      set(CMAKE_REQUIRED_FLAGS)

-    if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-        set(CMAKE_REQUIRED_FLAGS "-msse3")
-    endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+      check_cxx_source_runs("
+          #include <mm_malloc.h>
+          int main()
+          {
+            void* mem = _mm_malloc (100, 16);
+            return 0;
+          }"
+          HAVE_MM_MALLOC)

-    check_cxx_source_runs("
-        #include <pmmintrin.h>
-        int main()
-        {
-            __m128d a, b;
-            double vals[2] = {0};
-            a = _mm_loadu_pd(vals);
-            b = _mm_hadd_pd(a,a);
-            _mm_storeu_pd(vals, b);
-            return 0;
-        }"
-        HAVE_SSE3_EXTENSIONS)
+      check_cxx_source_runs("
+          #include <stdlib.h>
+          int main()
+          {
+            void* mem;
+            return posix_memalign (&mem, 16, 100);
+          }"
+          HAVE_POSIX_MEMALIGN)

-    if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-        set(CMAKE_REQUIRED_FLAGS "-msse2")
-    elseif(MSVC AND NOT CMAKE_CL_64)
-        set(CMAKE_REQUIRED_FLAGS "/arch:SSE2")
-    endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-
-    check_cxx_source_runs("
-        #include <emmintrin.h>
-        int main()
-        {
-            __m128d a, b;
-            double vals[2] = {0};
-            a = _mm_loadu_pd(vals);
-            b = _mm_add_pd(a,a);
-            _mm_storeu_pd(vals,b);
-            return 0;
-        }"
-        HAVE_SSE2_EXTENSIONS)
+      if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+          set(CMAKE_REQUIRED_FLAGS "-msse4.1")
+      endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)

-    if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-        set(CMAKE_REQUIRED_FLAGS "-msse")
-    elseif(MSVC AND NOT CMAKE_CL_64)
-        set(CMAKE_REQUIRED_FLAGS "/arch:SSE")
-    endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-
-    check_cxx_source_runs("
-        #include <xmmintrin.h>
-        int main()
-        {
+      check_cxx_source_runs("
+          #include <smmintrin.h>
+          int main()
+          {
             __m128 a, b;
-            float vals[4] = {0};
+            float vals[4] = {1, 2, 3, 4};
+            const int mask = 123;
             a = _mm_loadu_ps(vals);
             b = a;
-            b = _mm_add_ps(a,b);
+            b = _mm_dp_ps (a, a, mask);
             _mm_storeu_ps(vals,b);
             return 0;
-        }"
-        HAVE_SSE_EXTENSIONS)
+          }"
+          HAVE_SSE4_1_EXTENSIONS)

-    set(CMAKE_REQUIRED_FLAGS)
+      if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+          set(CMAKE_REQUIRED_FLAGS "-msse3")
+      endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)

-    if (NOT APPLE AND NOT MSVC)
-        SET(SSE_FLAGS "${SSE_FLAGS} -march=native")
-    elseif (APPLE)
-        if (HAVE_SSE4_1_EXTENSIONS)
-            SET(SSE_FLAGS "${SSE_FLAGS} -msse4.1 -mfpmath=sse")
-            message(STATUS "Found SSE4.1 extensions, using flags: ${SSE_FLAGS}")
-        elseif(HAVE_SSE3_EXTENSIONS)
-            SET(SSE_FLAGS "${SSE_FLAGS} -msse3 -mfpmath=sse")
-            message(STATUS "Found SSE3 extensions, using flags: ${SSE_FLAGS}")
-        elseif(HAVE_SSE2_EXTENSIONS)
-            SET(SSE_FLAGS "${SSE_FLAGS} -msse2 -mfpmath=sse")
-            message(STATUS "Found SSE2 extensions, using flags: ${SSE_FLAGS}")
-        elseif(HAVE_SSE_EXTENSIONS)
-            SET(SSE_FLAGS "${SSE_FLAGS} -msse -mfpmath=sse")
-            message(STATUS "Found SSE extensions, using flags: ${SSE_FLAGS}")
-        else (HAVE_SSE4_1_EXTENSIONS)
-            message(STATUS "No SSE extensions found")
-        endif(HAVE_SSE4_1_EXTENSIONS)
-    elseif (MSVC AND NOT CMAKE_CL_64)
-        if(HAVE_SSE2_EXTENSIONS)
-            SET(SSE_FLAGS "${SSE_FLAGS} /arch:SSE2")
-            message(STATUS "Found SSE2 extensions, using flags: ${SSE_FLAGS}")
-        elseif(HAVE_SSE_EXTENSIONS)
-            SET(SSE_FLAGS "${SSE_FLAGS} /arch:SSE")
-            message(STATUS "Found SSE extensions, using flags: ${SSE_FLAGS}")
-        endif(HAVE_SSE2_EXTENSIONS)
-    endif (NOT APPLE AND NOT MSVC)
-
+      check_cxx_source_runs("
+          #include <pmmintrin.h>
+          int main()
+          {
+              __m128d a, b;
+              double vals[2] = {0};
+              a = _mm_loadu_pd(vals);
+              b = _mm_hadd_pd(a,a);
+              _mm_storeu_pd(vals, b);
+              return 0;
+          }"
+          HAVE_SSE3_EXTENSIONS)
+
+      if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+          set(CMAKE_REQUIRED_FLAGS "-msse2")
+      elseif(MSVC AND NOT CMAKE_CL_64)
+          set(CMAKE_REQUIRED_FLAGS "/arch:SSE2")
+      endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+
+      check_cxx_source_runs("
+          #include <emmintrin.h>
+          int main()
+          {
+              __m128d a, b;
+              double vals[2] = {0};
+              a = _mm_loadu_pd(vals);
+              b = _mm_add_pd(a,a);
+              _mm_storeu_pd(vals,b);
+              return 0;
+          }"
+          HAVE_SSE2_EXTENSIONS)
+
+      if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+          set(CMAKE_REQUIRED_FLAGS "-msse")
+      elseif(MSVC AND NOT CMAKE_CL_64)
+          set(CMAKE_REQUIRED_FLAGS "/arch:SSE")
+      endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+
+      check_cxx_source_runs("
+          #include <xmmintrin.h>
+          int main()
+          {
+              __m128 a, b;
+              float vals[4] = {0};
+              a = _mm_loadu_ps(vals);
+              b = a;
+              b = _mm_add_ps(a,b);
+              _mm_storeu_ps(vals,b);
+              return 0;
+          }"
+          HAVE_SSE_EXTENSIONS)
+
+      set(CMAKE_REQUIRED_FLAGS)
+
+      if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+          if (HAVE_SSE4_1_EXTENSIONS)
+              SET(SSE_FLAGS "${SSE_FLAGS} -msse4.1 -mfpmath=sse")
+              message(STATUS "Found SSE4.1 extensions, using flags: ${SSE_FLAGS}")
+          elseif(HAVE_SSE3_EXTENSIONS)
+              SET(SSE_FLAGS "${SSE_FLAGS} -msse3 -mfpmath=sse")
+              message(STATUS "Found SSE3 extensions, using flags: ${SSE_FLAGS}")
+          elseif(HAVE_SSE2_EXTENSIONS)
+              SET(SSE_FLAGS "${SSE_FLAGS} -msse2 -mfpmath=sse")
+              message(STATUS "Found SSE2 extensions, using flags: ${SSE_FLAGS}")
+          elseif(HAVE_SSE_EXTENSIONS)
+              SET(SSE_FLAGS "${SSE_FLAGS} -msse -mfpmath=sse")
+              message(STATUS "Found SSE extensions, using flags: ${SSE_FLAGS}")
+          else (HAVE_SSE4_1_EXTENSIONS)
+              message(STATUS "No SSE extensions found")
+          endif(HAVE_SSE4_1_EXTENSIONS)
+      elseif (MSVC)
+          if(HAVE_SSE2_EXTENSIONS)
+              SET(SSE_FLAGS "${SSE_FLAGS} /arch:SSE2")
+              message(STATUS "Found SSE2 extensions, using flags: ${SSE_FLAGS}")
+          elseif(HAVE_SSE_EXTENSIONS)
+              SET(SSE_FLAGS "${SSE_FLAGS} /arch:SSE")
+              message(STATUS "Found SSE extensions, using flags: ${SSE_FLAGS}")
+          endif(HAVE_SSE2_EXTENSIONS)
+      endif ()
+
+    endif()
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SSE_FLAGS}")
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SSE_FLAGS}")


FIRE-13896: Make sure to use our libpangocairo when building on 64-bit Linux.

--- indra/cmake/UI.cmake
+++ indra/cmake/UI.cmake
@@ -49,6 +49,14 @@
         pangox-1.0
         pangoxft-1.0
         )
+
+    if (ND_BUILD64BIT_ARCH)
+      set(UI_LIB_NAMES ${UI_LIB_NAMES}
+          gio-2.0
+          pangocairo-1.0
+          )
+    endif(ND_BUILD64BIT_ARCH)
+
     foreach(libname ${UI_LIB_NAMES})
       find_library(UI_LIB_${libname}
                    NAMES ${libname}
@@ -59,17 +67,6 @@
                    )
       set(UI_LIBRARIES ${UI_LIBRARIES} ${UI_LIB_${libname}})
     endforeach(libname)
-
-    if (ND_BUILD64BIT_ARCH)
-      find_library(UI_LIB_gio-2.0
-                   NAMES gio-2.0
-                   PATHS
-                     debug ${LIBS_PREBUILT_DIR}/lib/debug
-                     optimized ${LIBS_PREBUILT_DIR}/lib/release
-                   NO_DEFAULT_PATH
-                   )
-      set(UI_LIBRARIES ${UI_LIBRARIES} ${UI_LIB_gio-2.0})
-    endif(ND_BUILD64BIT_ARCH)

     set(UI_LIBRARIES ${UI_LIBRARIES} Xinerama)
   endif (LINUX)


fixed: init contribcompute dependencies

fixed: init contribcompute dependencies

git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@2266 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/ExternalProjectHelper.cmake
+++ CMake/ExternalProjectHelper.cmake
@@ -47,6 +47,7 @@

     LIST(FIND _OSG_COMPONENTS OSGFileIO _OSG_USE_FILEIO)
     LIST(FIND _OSG_COMPONENTS OSGImageFileIO _OSG_USE_IMAGEFILEIO)
+    LIST(FIND _OSG_COMPONENTS OSGContribComputeBase _OSG_USE_CONTRIBCOMPUTE)

   ENDIF(OpenSG_DIR)

@@ -135,6 +136,25 @@
     ENDIF(COLLADA_FOUND)
   ENDIF(_OSG_USE_FILEIO)

+  IF(_OSG_USE_CONTRIBCOMPUTE)
+    FIND_PACKAGE(CUDA QUIET REQUIRED)
+
+    INCLUDE(ConfigurePackages.OSGContribComputeBase)
+
+    IF(NOT OSG_BUILD_DEPENDEND)
+      OSG_CONFIGURE_NVSDKCOMMON()
+      OSG_CONFIGURE_NVOCLUTILS()
+      OSG_CONFIGURE_CUDACOMMON()
+      OSG_CONFIGURE_CUDAUTIL()
+      OSG_CONFIGURE_CUDPP()
+      OSG_CONFIGURE_CUDAPARTSDK()
+    ENDIF(NOT OSG_BUILD_DEPENDEND)
+
+    MESSAGE(STATUS "NV Status: NV:${OSG_NVSDKCOMMON_FOUND}")
+    MESSAGE(STATUS "Cuda Status: CC:${OSG_CUDACOMMON_FOUND} CU:${OSG_CUDAUTIL_FOUND} CP:${OSG_CUDPP_FOUND}")
+    MESSAGE(STATUS "OCL Status : NV:${OSG_NVOCLUTILS_FOUND}")
+  ENDIF(_OSG_USE_CONTRIBCOMPUTE)
+
   CHECK_BUILD_DIR()

   SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)


Don't generate code for header only modules

--- CMake/mitkMacroCreateModule.cmake
+++ CMake/mitkMacroCreateModule.cmake
@@ -241,7 +241,7 @@
           set(_STATIC )
         endif(MODULE_FORCE_STATIC)

-        if(NOT MODULE_NO_INIT)
+        if(NOT MODULE_NO_INIT AND NOT MODULE_HEADERS_ONLY)
           set(MODULE_LIBNAME ${MODULE_PROVIDES})

           usFunctionGenerateModuleInit(CPP_FILES


Update VisomicsData external project so that branch xcorrel-flip is used

* Topic is referenced with its SHA1 so that it's not dependent on the topic name

* origin/master will have to be used when the topic will be merged

--- CMakeExternals/VisomicsData.cmake
+++ CMakeExternals/VisomicsData.cmake
@@ -19,7 +19,7 @@
     MESSAGE(STATUS "Adding external project: ${proj}")
     ExternalProject_Add(${proj}
       GIT_REPOSITORY ${git_protocol}://kwsource.kitwarein.com/bioinformatics/visomicsdata.git
-      GIT_TAG "origin/master"
+      GIT_TAG "447afc6"
       SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
       BINARY_DIR ${proj}-build
       PREFIX ${proj}${ep_suffix}


Add Ed25519 to AMCL build.

Add Ed25519 to AMCL build.

This is because we need to use a curve-point-validation function that's
available in the ECDH part of AMCL, but the linker complains when we
use that function unless we also build an ECDH-related package (like
Ed25519).

--- cmake/FindAMCL.cmake
+++ cmake/FindAMCL.cmake
@@ -19,7 +19,10 @@
 set(AMCL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/amcl/)
 set(AMCL_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../amcl/version3/c/)
 set(AMCL_HEADER_DIR ${CMAKE_CURRENT_BINARY_DIR}/amcl/amcl/)
-set(AMCL_CONFIG_OPTIONS "17\\n0\\n")    # builds BN254 pairing-friendly curve, only
+
+# Set config options to build BN254 pairing-friendly curve
+# (and Ed25519, to satisfy the linker when we use some ECDH-related functions)
+set(AMCL_CONFIG_OPTIONS "1\\n17\\n0\\n")
 if (NOT TARGET AMCL)
         ExternalProject_Add(AMCL
                 PREFIX ${AMCL_PREFIX}


Oprofile support needs to be compiled specifically into LLVM, disabling.

--- cmake/FindLLVM.cmake
+++ cmake/FindLLVM.cmake
@@ -104,7 +104,8 @@
       STRING(REGEX REPLACE "${f}" "" LLVM_CXXFLAGS "${LLVM_CXXFLAGS}")
   endforeach()

-  set(llvm_libs "object core bitreader bitwriter linker asmparser interpreter executionengine jit mcjit runtimedyld nativecodegen ipo irreader x86asmparser oprofilejit")
+  # This needs oprofile support in LLVM: oprofilejit
+  set(llvm_libs "object core bitreader bitwriter linker asmparser interpreter executionengine jit mcjit runtimedyld nativecodegen ipo irreader x86asmparser")
   exec_program(${LLVM_CONFIG_EXEC} ARGS --libs ${llvm_libs} OUTPUT_VARIABLE LLVM_LIBS)

   set(LLVM_LDFLAGS "${LLVM_LDFLAGS} -Wl,-rpath,${LLVM_LIB_DIR}")


updated find qwt5 macro as it was finding qwt6 by mistake and breaking the build on ubuntu 11.10 - this change needs testing further

--- cmake/FindQwt5.cmake
+++ cmake/FindQwt5.cmake
@@ -55,52 +55,47 @@

     # Find Qwt version
     IF( Qwt5_INCLUDE_DIR )
-    FILE( READ ${Qwt5_INCLUDE_DIR}/qwt_global.h QWT_GLOBAL_H )
-    STRING( REGEX MATCH "#define *QWT_VERSION *(0x05*)" QWT_IS_VERSION_5 ${QWT_GLOBAL_H})
+        FILE( READ ${Qwt5_INCLUDE_DIR}/qwt_global.h QWT_GLOBAL_H )
+        STRING( REGEX MATCH "0x05" QWT_IS_VERSION_5 ${QWT_GLOBAL_H})

-    IF( QWT_IS_VERSION_5 )
-    STRING(REGEX REPLACE ".*#define[\\t\\ ]+QWT_VERSION_STR[\\t\\ ]+\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" "\\1" Qwt_VERSION "${QWT_GLOBAL_H}")
+        IF( QWT_IS_VERSION_5 )
+            STRING(REGEX REPLACE ".*#define[\\t\\ ]+QWT_VERSION_STR[\\t\\ ]+\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" "\\1" Qwt_VERSION "${QWT_GLOBAL_H}")
+
+            # Find Qwt5 library linked to Qt4
+            FIND_LIBRARY( Qwt5_Qt4_TENTATIVE_LIBRARY NAMES qwt5-qt4 qwt-qt4 qwt5 qwt PATHS /usr/local/qwt/lib /usr/local/lib /usr/lib ${QT_LIBRARY_DIR})
+            IF( UNIX AND NOT CYGWIN)
+            IF( Qwt5_Qt4_TENTATIVE_LIBRARY )
+            IF( NOT APPLE )
+            EXECUTE_PROCESS( COMMAND "ldd" ${Qwt5_Qt4_TENTATIVE_LIBRARY} OUTPUT_VARIABLE Qwt_Qt4_LIBRARIES_LINKED_TO )
+            ENDIF( NOT APPLE )
+            IF( APPLE )
+            EXECUTE_PROCESS( COMMAND "otool" "-L" ${Qwt5_Qt4_TENTATIVE_LIBRARY} OUTPUT_VARIABLE Qwt_Qt4_LIBRARIES_LINKED_TO )
+            ENDIF( APPLE )
+            STRING( REGEX MATCH "QtCore" Qwt5_IS_LINKED_TO_Qt4 ${Qwt_Qt4_LIBRARIES_LINKED_TO})
+            IF( Qwt5_IS_LINKED_TO_Qt4 )
+            SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} )
+            SET( Qwt5_Qt4_FOUND TRUE )
+            IF (NOT Qwt5_FIND_QUIETLY)
+            MESSAGE( STATUS "Found Qwt: ${Qwt5_Qt4_LIBRARY}" )
+            ENDIF (NOT Qwt5_FIND_QUIETLY)
+            ENDIF( Qwt5_IS_LINKED_TO_Qt4 )
+            ENDIF( Qwt5_Qt4_TENTATIVE_LIBRARY )
+            ELSE( UNIX AND NOT CYGWIN)
+            # Assumes qwt.dll is in the Qt dir
+            SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} )
+            SET( Qwt5_Qt4_FOUND TRUE )
+            IF (NOT Qwt5_FIND_QUIETLY)
+            MESSAGE( STATUS "Found Qwt version ${Qwt_VERSION} linked to Qt4" )
+            ENDIF (NOT Qwt5_FIND_QUIETLY)
+            ENDIF( UNIX AND NOT CYGWIN)
+        ENDIF( QWT_IS_VERSION_5 )

-    # Find Qwt5 library linked to Qt4
-    FIND_LIBRARY( Qwt5_Qt4_TENTATIVE_LIBRARY NAMES qwt5-qt4 qwt-qt4 qwt5 qwt PATHS /usr/local/qwt/lib /usr/local/lib /usr/lib ${QT_LIBRARY_DIR})
-    IF( UNIX AND NOT CYGWIN)
-    IF( Qwt5_Qt4_TENTATIVE_LIBRARY )
-    IF( NOT APPLE )
-    EXECUTE_PROCESS( COMMAND "ldd" ${Qwt5_Qt4_TENTATIVE_LIBRARY} OUTPUT_VARIABLE Qwt_Qt4_LIBRARIES_LINKED_TO )
-    ENDIF( NOT APPLE )
-    IF( APPLE )
-    EXECUTE_PROCESS( COMMAND "otool" "-L" ${Qwt5_Qt4_TENTATIVE_LIBRARY} OUTPUT_VARIABLE Qwt_Qt4_LIBRARIES_LINKED_TO )
-    ENDIF( APPLE )
-    STRING( REGEX MATCH "QtCore" Qwt5_IS_LINKED_TO_Qt4 ${Qwt_Qt4_LIBRARIES_LINKED_TO})
-    IF( Qwt5_IS_LINKED_TO_Qt4 )
-    SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} )
-    SET( Qwt5_Qt4_FOUND TRUE )
-    IF (NOT Qwt5_FIND_QUIETLY)
-    MESSAGE( STATUS "Found Qwt: ${Qwt5_Qt4_LIBRARY}" )
-    ENDIF (NOT Qwt5_FIND_QUIETLY)
-    ENDIF( Qwt5_IS_LINKED_TO_Qt4 )
-    ENDIF( Qwt5_Qt4_TENTATIVE_LIBRARY )
-    ELSE( UNIX AND NOT CYGWIN)
-    # Assumes qwt.dll is in the Qt dir
-    SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} )
-    SET( Qwt5_Qt4_FOUND TRUE )
-    IF (NOT Qwt5_FIND_QUIETLY)
-    MESSAGE( STATUS "Found Qwt version ${Qwt_VERSION} linked to Qt4" )
-    ENDIF (NOT Qwt5_FIND_QUIETLY)
-    ENDIF( UNIX AND NOT CYGWIN)
-
-
-    ENDIF( QWT_IS_VERSION_5 )
-
-    IF( Qwt5_Qt4_FOUND OR Qwt5_Qt3_FOUND )
-    SET( Qwt5_FOUND TRUE )
-    ENDIF( Qwt5_Qt4_FOUND OR Qwt5_Qt3_FOUND )
-
-    MARK_AS_ADVANCED( Qwt5_INCLUDE_DIR Qwt5_Qt4_LIBRARY Qwt5_Qt3_LIBRARY )
+        IF( Qwt5_Qt4_FOUND OR Qwt5_Qt3_FOUND )
+            SET( Qwt5_FOUND TRUE )
+        ENDIF( Qwt5_Qt4_FOUND OR Qwt5_Qt3_FOUND )
+        MARK_AS_ADVANCED( Qwt5_INCLUDE_DIR Qwt5_Qt4_LIBRARY Qwt5_Qt3_LIBRARY )
     ENDIF( Qwt5_INCLUDE_DIR )
-
     IF (NOT Qwt5_FOUND AND Qwt5_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR "Could not find Qwt 5.x")
+        MESSAGE(FATAL_ERROR "Could not find Qwt 5.x")
     ENDIF (NOT Qwt5_FOUND AND Qwt5_FIND_REQUIRED)
-
 ENDIF( QT4_FOUND )


Clarify suggestion to install Vala or specify the version

--- cmake/FindVala.cmake
+++ cmake/FindVala.cmake
@@ -6,7 +6,7 @@
     string(REPLACE "Vala " "" VALA_VERSION ${VALA_VERSION})
     string(STRIP ${VALA_VERSION} VALA_VERSION)
 else ()
-    message(FATAL_ERROR "valac not found - re-run with VALAC=valac-0.20 with an available valac version")
+    message(FATAL_ERROR "valac not found - install Vala compiler or specify compiler name eg. VALAC=valac-0.20")
 endif ()

 macro(vala_require VALA_REQUIRED)


preparation des dossiers pour cegui, mise à jour cmake générant ressource.cfg

--- cmake/Function.cmake
+++ cmake/Function.cmake
@@ -137,5 +137,14 @@
 	file(APPEND ${FILE_DEST} "FileSystem=${CMAKE_SOURCE_DIR}/media/models\n")
 	file(APPEND ${FILE_DEST} "FileSystem=${CMAKE_SOURCE_DIR}/media/particle\n")
 	file(APPEND ${FILE_DEST} "Zip=${CMAKE_SOURCE_DIR}/media/packs/skybox.zip\n")
-
+	file(APPEND ${FILE_DEST} "[Imagesets]\n")
+	file(APPEND ${FILE_DEST} "FileSystem=${CMAKE_SOURCE_DIR}/cegui/imagesets\n")
+   	file(APPEND ${FILE_DEST} "[Fonts]\n")
+	file(APPEND ${FILE_DEST} "FileSystem=${CMAKE_SOURCE_DIR}/cegui/fonts\n")
+	file(APPEND ${FILE_DEST} "[LookNFeel]\n")
+	file(APPEND ${FILE_DEST} "FileSystem=${CMAKE_SOURCE_DIR}/cegui/looknfeel\n")
+    file(APPEND ${FILE_DEST} "[Schemes]\n")
+	file(APPEND ${FILE_DEST} "FileSystem=${CMAKE_SOURCE_DIR}/cegui/schemes\n")
+	file(APPEND ${FILE_DEST} "[Layout]\n")
+	file(APPEND ${FILE_DEST} "FileSystem=${CMAKE_SOURCE_DIR}/cegui/layouts\n")
 endmacro(writeResourceFile)


silence false positives about aliasing from GCC 4.4.7

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -254,6 +254,9 @@
          string(REPLACE " -Wparentheses " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
          string(REPLACE " -Wparentheses " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
          set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -Wno-parentheses")
+
+         UserWarning("GCC 4.4.x shows false positives for -Wstrict-aliasing, thus we rather disable the warning. Use a newer GCC for better warnings.")
+         AddCompilerFlag("-Wno-strict-aliasing")
       elseif(Vc_GCC_VERSION VERSION_EQUAL 4.6.0)
          UserWarning("GCC 4.6.0 miscompiles AVX loads/stores, leading to spurious segfaults. Disabling AVX per default.")
          set(Vc_AVX_INTRINSICS_BROKEN true)


Add CMAKE_BUILD_TYPE to UFID translation. For bbcmake integration.

--- cmake/bde_ufid.cmake
+++ cmake/bde_ufid.cmake
@@ -605,10 +605,25 @@
 endfunction()

 function(bde_process_ufid)
-    if( NOT UFID )
-        message(WARNING "UFID is not defined.")
-        message(STATUS  "Setting default UFID to 'opt_mt_exc'.")
-        set(UFID "opt_mt_exc" CACHE STRING "UFID for the project")
+    if(NOT UFID)
+        if(CMAKE_BUILD_TYPE)
+            if(CMAKE_BUILD_TYPE STREQUAL "Release")
+                message(STATUS  "Setting 'Release' to UFID to 'opt_mt_exc'.")
+                set(UFID "opt_mt_exc" CACHE STRING "UFID for the project")
+            endif()
+            if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
+                message(STATUS  "Setting 'RelWithDebInfo' to UFID to 'opt_dbg_mt_exc'.")
+                set(UFID "opt_dbg_mt_exc" CACHE STRING "UFID for the project")
+            endif()
+            if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+                message(STATUS  "Setting 'Debug' to UFID to 'dbg_mt_exc'.")
+                set(UFID "dbg_mt_exc" CACHE STRING "UFID for the project")
+            endif()
+        else()
+            message(WARNING "Nor CMAKE_BUILD_TYPE nor UFID is defined.")
+            message(STATUS  "Setting default UFID to 'opt_mt_exc'.")
+            set(UFID "opt_mt_exc" CACHE STRING "UFID for the project")
+        endif()
     endif()

     bde_parse_ufid(${UFID})


Set variables in the good order

Set variables in the good order

--- DefineOptions.cmake
+++ DefineOptions.cmake
@@ -11,9 +11,11 @@
 option(WITH_TESTING "Build with unit tests" OFF)
 option(WITH_CLIENT_TESTING "Build with client tests; requires a running sshd" OFF)
 option(WITH_BENCHMARKS "Build benchmarks tools" OFF)
+
+if(WITH_BENCHMARKS)
+  set(WITH_TESTING ON)
+endif(WITH_BENCHMARKS)
+
 if (WITH_TESTING)
   set(WITH_STATIC_LIB ON)
 endif (WITH_TESTING)
-if(WITH_BENCHMARKS)
-  set(WITH_TESTING ON)
-endif(WITH_BENCHMARKS)


Fix CGAL url hash

Fix CGAL url hash

--- deps/CGAL/CGAL.cmake
+++ deps/CGAL/CGAL.cmake
@@ -4,7 +4,7 @@
     # GIT_TAG        bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0
     # For whatever reason, this keeps downloading forever (repeats downloads if finished)
     URL      https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip
-    URL_HASH SHA256=bd9327be903ab7ee379a8a7a0609eba0962f5078d2497cf8e13e8e1598584154
+    URL_HASH SHA256=c2b035bd078687b6d8c0fb6371a7443adcdb647856af9969532c4050cd5f48e5
     DEPENDS dep_Boost dep_GMP dep_MPFR
 )


CMake downward compatibility

CMake downward compatibility

--- cmake/External.cmake
+++ cmake/External.cmake
@@ -56,9 +56,12 @@

   # Compose arguments for external project
   set(GEN_ARGS "-G${CMAKE_GENERATOR}")
-
-  if(CMAKE_GENERATOR_PLATFORM AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.14.0")
-    set(GEN_ARGS "${GEN_ARGS} -A${CMAKE_GENERATOR_PLATFORM}")
+  string(FIND "${CMAKE_GENERATOR}" "Visual Studio" IS_VS)
+
+  if("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 16 2019")
+    set(GEN_ARGS "${GEN_ARGS} -Ax64")
+  elseif(${IS_VS} GREATER -1)
+    set(GEN_ARGS "${GEN_ARGS} Win64")
   endif()

   if(CMAKE_TOOLCHAIN_FILE)
@@ -97,7 +100,7 @@
           -DCMAKE_INSTALL_PREFIX:PATH=${${lcName}_INSTALL_DIR}/${BUILD_CONFIG}
           -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
           -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-          -S${${lcName}_SOURCE_DIR}
+          ${${lcName}_SOURCE_DIR}
         WORKING_DIRECTORY "${${lcName}_BINARY_DIR}/${BUILD_CONFIG}"
         OUTPUT_QUIET
         RESULT_VARIABLE CONFIG_RESULT)
@@ -109,7 +112,7 @@
         -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
         -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
         -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-        -S${${lcName}_SOURCE_DIR}
+        ${${lcName}_SOURCE_DIR}
       WORKING_DIRECTORY "${${lcName}_BINARY_DIR}"
       OUTPUT_QUIET
       RESULT_VARIABLE CONFIG_RESULT)


fix linking with GLFW link on OSX

fix linking with GLFW link on OSX

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -211,7 +211,7 @@
     endif()

     # static builds of glfw require Xrandr
-    if( UNIX AND GLFW_FOUND)
+    if( NOT WIN32 AND NOT APPLE AND GLFW_FOUND)
         list(APPEND GLFW_LIBRARIES -lXrandr -lXxf86vm)
     endif()
 endif(GLFW_INCLUDE_DIR)


build: try to find llvm-config-7 before llvm-config

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -8,7 +8,7 @@
 # LLVM_LIBDIRS

 find_program(LLVM_CONFIG_EXE
-    NAMES llvm-config llvm-config-7 llvm-config-7.0
+    NAMES llvm-config-7 llvm-config-7.0 llvm-config
     PATHS
         "/mingw64/bin"
         "/c/msys64/mingw64/bin"


cmake: don't require pkg-config

cmake: don't require pkg-config

--- cmake/Findzstd.cmake
+++ cmake/Findzstd.cmake
@@ -18,8 +18,10 @@
   return()
 endif()

-find_package(PkgConfig REQUIRED)
-pkg_check_modules(LIBZSTD libzstd)
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+  pkg_check_modules(LIBZSTD libzstd)
+endif()

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(zstd


cmake: net: qemu: Don't pass "-serial none" to qemu

I don't know why we have been passing "-serial none" to qemu but it
does not seem to be doing anything useful. So I propose we remove it.

According to the qemu documenation it should be disabling all serial
ports;

"-serial dev
Redirect the virtual serial port to host character device dev. The
default device is vc in graphical mode and stdio in non graphical
mode.

This option can be used several times to simulate up to 4 serial
ports.

Use -serial none to disable all serial ports."

But when we use "-serial none", we always combine it with "-serial
pipe", or "-serial unix", to redirect the serial port, so clearly it
is not disabling all serial ports as it attempting to do.

"-serial none" was first introduced to Zephyr in this commit:
0b54f984b8a456041d458b5b2b004af86d152161

As far I can tell, pinging an echo_server works fine without it, so I
suspect that our second -serial flag is overriding it and that it has
no effect.

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

--- cmake/emu/qemu.cmake
+++ cmake/emu/qemu.cmake
@@ -70,10 +70,6 @@
   list(APPEND qemu_targets
     client
     server
-    )
-
-  list(APPEND QEMU_FLAGS
-    -serial none
     )

   foreach(target ${qemu_targets})


cmake: Indentation cleanup

cmake: Indentation cleanup


some refactoring around readline/libedit  (handle dependent options, allow user with change WITH_READLINE to WITH_LIBEDIT and other way around after the first compile)

--- cmake/readline.cmake
+++ cmake/readline.cmake
@@ -12,16 +12,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-MACRO(SET_WITH_BUNDLED_READLINE option)
-  IF(option)
-   SET(not_option OFF)
-  ELSE()
-   SET(not_option ON)
-  ENDIF()
-  SET(WITH_READLINE ${option} CACHE BOOL "Use bundled readline")
-  SET(WITH_LIBEDIT ${not_option} CACHE BOOL "Use bundled libedit")
-ENDMACRO()

 MACRO (MYSQL_CHECK_MULTIBYTE)
   CHECK_INCLUDE_FILE(wctype.h HAVE_WCTYPE_H)
@@ -119,8 +109,9 @@
 ENDMACRO()

 MACRO (MYSQL_USE_BUNDLED_READLINE)
-  SET_WITH_BUNDLED_READLINE(ON)
   SET(USE_NEW_READLINE_INTERFACE 1)
+  SET(HAVE_HIST_ENTRY)
+  SET(USE_LIBEDIT_INTERFACE)
   SET(READLINE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/cmd-line-utils)
   SET(READLINE_LIBRARY readline)
   FIND_CURSES()
@@ -128,26 +119,27 @@
 ENDMACRO()

 MACRO (MYSQL_USE_BUNDLED_LIBEDIT)
-  SET_WITH_BUNDLED_READLINE(OFF)
-  SET(USE_LIBEDIT_INTERFACE 1 CACHE INTERNAL "")
-  SET(HAVE_HIST_ENTRY 1 CACHE INTERNAL "")
-  SET(READLINE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/cmd-line-utils/libedit")
+  SET(USE_LIBEDIT_INTERFACE 1)
+  SET(HAVE_HIST_ENTRY 1)
+  SET(READLINE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/cmd-line-utils/libedit)
   SET(READLINE_LIBRARY edit)
   FIND_CURSES()
   ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/cmd-line-utils/libedit)
 ENDMACRO()

+
 MACRO (MYSQL_FIND_SYSTEM_READLINE name)
-  FIND_PATH(SYSTEM_READLINE_INCLUDE_DIR readline/readline.h )
-  FIND_LIBRARY(SYSTEM_READLINE_LIBRARY NAMES ${name})
-  MARK_AS_ADVANCED(SYSTEM_READLINE_INCLUDE_DIR  SYSTEM_READLINE_LIBRARY)
+
+  FIND_PATH(${name}_INCLUDE_DIR readline/readline.h )
+  FIND_LIBRARY(${name}_LIBRARY NAMES ${name})
+  MARK_AS_ADVANCED(${name}_INCLUDE_DIR  ${name}_LIBRARY)

   INCLUDE(CheckCXXSourceCompiles)
-  SET(CMAKE_REQUIRES_LIBRARIES ${SYSTEM_READLINE_LIBRARY})
-
-  IF(SYSTEM_READLINE_LIBRARY AND SYSTEM_READLINE_INCLUDE_DIR)
+  SET(CMAKE_REQUIRES_LIBRARIES ${${name}_LIBRARY})
+
+  IF(${name}_LIBRARY AND ${name}_INCLUDE_DIR)
     SET(SYSTEM_READLINE_FOUND 1)
-    SET(CMAKE_REQUIRED_LIBRARIES ${SYSTEM_READLINE_LIBRARY})
+    SET(CMAKE_REQUIRED_LIBRARIES ${${name}_LIBRARY})
     CHECK_CXX_SOURCE_COMPILES("
     #include <stdio.h>
     #include <readline/readline.h>
@@ -156,8 +148,8 @@
        HIST_ENTRY entry;
        return 0;
     }"
-    HAVE_HIST_ENTRY)
-
+    ${name}_HAVE_HIST_ENTRY)
+
     CHECK_CXX_SOURCE_COMPILES("
     #include <stdio.h>
     #include <readline/readline.h>
@@ -166,7 +158,7 @@
       char res= *(*rl_completion_entry_function)(0,0);
       completion_matches(0,0);
     }"
-    USE_LIBEDIT_INTERFACE)
+    ${name}_USE_LIBEDIT_INTERFACE)

     CHECK_CXX_SOURCE_COMPILES("
@@ -177,31 +169,48 @@
       rl_completion_func_t *func1= (rl_completion_func_t*)0;
       rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
     }"
-    USE_NEW_READLINE_INTERFACE)
+    ${name}_USE_NEW_READLINE_INTERFACE)

-    IF(USE_LIBEDIT_INTERFACE  OR USE_NEW_READLINE_INTERFACE)
-      SET(READLINE_LIBRARY ${SYSTEM_READLINE_LIBRARY})
-      SET(READLINE_INCLUDE_DIR ${SYSTEM_READLINE_INCLUDE_DIR})
+    IF(${name}_USE_LIBEDIT_INTERFACE  OR ${name}_USE_NEW_READLINE_INTERFACE)
+      SET(READLINE_LIBRARY ${${name}_LIBRARY})
+      SET(READLINE_INCLUDE_DIR ${${name}_INCLUDE_DIR})
+      SET(HAVE_HIST_ENTRY ${${name}_HAVE_HIST_ENTRY})
+      SET(USE_LIBEDIT_INTERFACE ${${name}_USE_LIBEDIT_INTERFACE})
+      SET(USE_NEW_READLINE_INTERFACE ${${name}_USE_NEW_READLINE_INTERFACE})
       SET(READLINE_FOUND 1)
     ENDIF()
   ENDIF()
 ENDMACRO()
+

 MACRO (MYSQL_CHECK_READLINE)
   IF (NOT WIN32)
     MYSQL_CHECK_MULTIBYTE()
-    OPTION(WITH_READLINE "Use bundled readline" OFF)
     IF(NOT CYGWIN)
-      # Bundled libedit does not compile on cygwin
-      OPTION(WITH_LIBEDIT  "Use bundled libedit" ON)
+      SET(WITH_LIBEDIT  ON CACHE BOOL  "Use bundled libedit")
+      SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline")
     ELSE()
-      OPTION(WITH_LIBEDIT  "Use bundled libedit" OFF)
+      # Bundled libedit does not compile on cygwin, only readline
+      SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline")
+    ENDIF()
+
+    # Handle mutual exclusion of WITH_READLINE/WITH_LIBEDIT variables
+    # We save current setting to recognize when user switched between
+    # WITH_READLINE and WITH_LIBEDIT
+    IF(WITH_READLINE AND SAVE_READLINE_SETTING MATCHES "WITH_LIBEDIT"
+      OR NOT SAVE_READLINE_SETTING )
+      SET(WITH_LIBEDIT OFF CACHE BOOL "Use bundled libedit" FORCE)
+    ELSEIF(WITH_LIBEDIT AND SAVE_READLINE_SETTING MATCHES "WITH_READLINE"
+      OR NOT SAVE_READLINE_SETTING )
+      SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline" FORCE)
     ENDIF()

     IF(WITH_READLINE)
      MYSQL_USE_BUNDLED_READLINE()
+     SET(SAVE_READLINE_SETTING WITH_READLINE CACHE INTERNAL "" FORCE)
     ELSEIF(WITH_LIBEDIT)
      MYSQL_USE_BUNDLED_LIBEDIT()
+     SET(SAVE_READLINE_SETTING WITH_LIBEDIT CACHE INTERNAL "" FORCE)
     ELSE()
       MYSQL_FIND_SYSTEM_READLINE(readline)
       IF(NOT READLINE_FOUND)


Remove some verbosity.

Remove some verbosity.

--- VigraAddDep.cmake
+++ VigraAddDep.cmake
@@ -240,11 +240,11 @@
       # - variables set by CMake's builtin find_package,
       # - args* (these are arguments to macros/functions).
       if(NOT _NEWVAR_LOW MATCHES "^_" AND NOT _NEWVAR_LOW MATCHES "^vad" AND NOT _NEWVAR_LOW MATCHES "^find_package" AND NOT _NEWVAR_LOW MATCHES "^argv[0-9]*" AND NOT _NEWVAR_LOW MATCHES "^argc" AND NOT _NEWVAR_LOW MATCHES "^argn")
-
+
         list(FIND _OLD_VARIABLES_${_VAD_NAME} "${_NEWVAR}" _NEWVARIDX)
-
+
         var_is_cached(${_NEWVAR} _NEWVAR_IS_CACHED)
-
+
         # variables might first be added to the cache by a package and then overwritten by the user
         # these should stay in cache and stay in new_vars list
         if (_NEWVAR_IS_CACHED)
@@ -318,7 +318,7 @@
 endfunction()

 function(vad_system_call _VAD_NAME)
-  message("call vad_system: ${_VAD_NAME} ${ARGN}")
+  #message("call vad_system: ${_VAD_NAME} ${ARGN}")
   vad_system(${_VAD_NAME} ${ARGN})
   # Check the FOUND flag.
   if(NOT ${_VAD_NAME}_FOUND)
@@ -333,7 +333,7 @@
 # will reset the hooks to their default implementations.
 function(vad_reset_hooks)
   function(vad_system)
-    message("call vad_system_default: [${_VAD_NAME}] ${ARGN} - ${ARGC}")
+    #message("call vad_system_default: [${_VAD_NAME}] ${ARGN} - ${ARGC}")
     vad_system_default(${ARGN})
   endfunction()
   function(vad_live _VAD_NAME)
@@ -365,7 +365,7 @@

   # Reset the hooks.
   vad_reset_hooks()
-
+
   if (_VAD_${_VAD_NAME}_ALIAS)
     set(_VAD_NAME ${_VAD_${_VAD_NAME}_ALIAS})
   endif()
@@ -434,7 +434,7 @@
       unset(GIT_CLONE_OPTS)
     else()
       message("${GIT_CLONE_OPTS}")
-      message("still have opts: VAD_${_VAD_NAME}_GIT_CLONE_OPTS_FILE ${VAD_${_VAD_NAME}_GIT_CLONE_OPTS_FILE}")
+      #message("still have opts: VAD_${_VAD_NAME}_GIT_CLONE_OPTS_FILE ${VAD_${_VAD_NAME}_GIT_CLONE_OPTS_FILE}")
     endif()
     # TODO: branch/commit.
     if(GIT_BRANCH)
@@ -500,10 +500,10 @@
     # endless recursion protection vad system might call find_package again...
     string(LENGTH "${_vigra_add_dep_running_${_VAD_NAME}_ARGS}" _vad_add_dep_prot_args_len)
     list(APPEND _vigra_add_dep_running_${_VAD_NAME}_ARGS "VAD_PROT_REC_START${ARGN}VAD_PROT_REC_STOP")
-    message("call sys call: ${_VAD_NAME} ${ARG_VAD_${_VAD_NAME}_UNPARSED_ARGUMENTS}")
+    #message("call sys call: ${_VAD_NAME} ${ARG_VAD_${_VAD_NAME}_UNPARSED_ARGUMENTS}")
     vad_system_call(${_VAD_NAME} ${ARG_VAD_${_VAD_NAME}_UNPARSED_ARGUMENTS})
     string(SUBSTRING "${_vigra_add_dep_running_${_VAD_NAME}_ARGS}" 0 ${_vad_add_dep_prot_args_len} _vigra_add_dep_running_${_VAD_NAME}_ARGS)
-
+
     if(VAD_${_VAD_NAME}_SYSTEM_NOT_FOUND)
       message(STATUS "Dependency ${_VAD_NAME} was not found system-wide, vigra_add_dep() will exit without marking the dependency as satisfied.")
       unset(VAD_${_VAD_NAME}_SYSTEM_NOT_FOUND CACHE)


BUILD_INTERFACE foreach include directory

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -749,7 +749,9 @@
       list(APPEND liblist "${${PKG}_LIBRARIES}")
     endif()
     if(DEFINED ${PKG}_INCLUDE_DIR)
-      list(APPEND incdirs "$<BUILD_INTERFACE:${${PKG}_INCLUDE_DIR}>")
+      foreach(idir ${${PKG}_INCLUDE_DIR})
+        list(APPEND incdirs "$<BUILD_INTERFACE:${idir}>")
+      endforeach()
     endif()
   endif()
   set(${_libList} ${liblist} PARENT_SCOPE)


linking concrete modules to cycluscore.

linking concrete modules to cycluscore.

--- cycamore/CMake/CycamoreModuleMacros.cmake
+++ cycamore/CMake/CycamoreModuleMacros.cmake
@@ -5,6 +5,8 @@

   # Build the libraries from the CYCAMORE_SRC source files
   ADD_LIBRARY( ${_name}       ${_name}.cpp )
+  # Link the libraries to libcycluscore
+  TARGET_LINK_LIBRARIES(${_name} dl cycluscore)
   SET(CYCAMORE_LIBRARIES ${CYCAMORE_LIBRARIES} ${_name} )


update externals in superbuild

update externals in superbuild

 - updates lcm and libbot externals
 - adds support for building against a drake superbuild
 - adds support for camera drivers and apriltags

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -4,6 +4,8 @@
 option(USE_LCM "Build with lcm." OFF)
 option(USE_LCMGL "Build with lcm-gl." OFF)
 option(USE_OCTOMAP "Build with octomap." OFF)
+option(USE_APRILTAGS "Build with apriltags lcm driver." OFF)
+option(USE_KINECT "Build with kinect lcm driver." OFF)
 option(USE_COLLECTIONS "Build with collections." OFF)
 option(USE_LIBBOT "Build with libbot." OFF)
 option(USE_DRAKE "Build with drake." OFF)
@@ -13,9 +15,21 @@
 option(USE_SYSTEM_EIGEN "Use system version of eigen.  If off, eigen will be built." OFF)
 option(USE_SYSTEM_LCM "Use system version of lcm.  If off, lcm will be built." OFF)
 option(USE_SYSTEM_LIBBOT "Use system version of libbot.  If off, libbot will be built." OFF)
+option(USE_SYSTEM_PCL "Use system version of pcl.  If off, pcl will be built." OFF)
+
+if(USE_DRAKE)
+  set(DRAKE_SOURCE_DIR CACHE PATH "")
+  set(DRAKE_SUPERBUILD_PREFIX_PATH "")
+  if(DRAKE_SOURCE_DIR)
+    set(DRAKE_SUPERBUILD_PREFIX_PATH "${DRAKE_SOURCE_DIR}/build/install")
+    if(NOT EXISTS "${DRAKE_SUPERBUILD_PREFIX_PATH}")
+        message(SEND_ERROR "Cannot find build directory in DRAKE_SOURCE_DIR: ${DRAKE_SOURCE_DIR}")
+    endif()
+  endif()
+endif()

 set(default_cmake_args
-  "-DCMAKE_PREFIX_PATH:PATH=${install_prefix};${CMAKE_PREFIX_PATH}"
+  "-DCMAKE_PREFIX_PATH:PATH=${install_prefix};${DRAKE_SUPERBUILD_PREFIX_PATH};${CMAKE_PREFIX_PATH}"
   "-DCMAKE_INSTALL_PREFIX:PATH=${install_prefix}"
   "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
   "-DBUILD_SHARED_LIBS:BOOL=ON"
@@ -101,7 +115,7 @@

   ExternalProject_Add(lcm
     GIT_REPOSITORY https://github.com/lcm-proj/lcm.git
-    GIT_TAG a8cda6a6
+    GIT_TAG 89f26a4
     ${cmake3_args}
     CMAKE_CACHE_ARGS
       ${default_cmake_args}
@@ -124,8 +138,8 @@
   endif()

   ExternalProject_Add(libbot
-    GIT_REPOSITORY https://github.com/RobotLocomotion/libbot.git
-    GIT_TAG 2cfd369
+    GIT_REPOSITORY https://github.com/RobotLocomotion/libbot2.git
+    GIT_TAG bc73f60
     CMAKE_CACHE_ARGS
       ${default_cmake_args}
       -DWITH_BOT_VIS:BOOL=OFF
@@ -142,7 +156,7 @@
 ###############################################################################
 # lcm message types repos

-if (USE_LCM)
+if (USE_LCM AND NOT USE_SYSTEM_LIBBOT)

   ExternalProject_Add(bot_core_lcmtypes
     GIT_REPOSITORY https://github.com/openhumanoids/bot_core_lcmtypes
@@ -207,6 +221,7 @@
   set(lcmgl_depends bot-lcmgl)

 endif()
+

 ###############################################################################
 # PythonQt
@@ -289,7 +304,7 @@
 ###############################################################################
 # pcl, flann

-if(USE_PCL)
+if(USE_PCL AND NOT USE_SYSTEM_PCL)

   # boost is an external dependency
   find_package(Boost REQUIRED)
@@ -375,9 +390,73 @@
     ${vtk_args}
     -DPCL_REQUIRED_VERSION:STRING=1.7.1
   DEPENDS
-    pcl
+    ${pcl_depends}
     ${vtk_depends}
   )
+
+endif()
+
+
+###############################################################################
+# camera driver
+
+if(USE_KINECT)
+
+  ExternalProject_Add(openni2-camera-lcm
+    GIT_REPOSITORY https://github.com/openhumanoids/openni2-camera-lcm
+    GIT_TAG master
+    CMAKE_CACHE_ARGS
+      ${default_cmake_args}
+    DEPENDS
+      ${lcm_depends}
+    )
+
+
+  ExternalProject_Add(cv-utils
+    GIT_REPOSITORY https://github.com/patmarion/cv-utils
+    GIT_TAG 1d1465d
+    CMAKE_CACHE_ARGS
+      ${default_cmake_args}
+    DEPENDS
+      ${lcm_depends} ${pcl_depends}
+    )
+
+  #ExternalProject_Add(kinect
+  #  GIT_REPOSITORY https://github.com/openhumanoids/kinect.git
+  #  GIT_TAG 3e94f58
+  #  CMAKE_CACHE_ARGS
+  #    ${default_cmake_args}
+  #  DEPENDS
+  #    ${lcm_depends} ${libbot_depends}
+  #  )
+
+  set(cvutils_depends cv-utils)
+
+endif()
+
+
+###############################################################################
+# apriltags
+
+if(USE_APRILTAGS)
+
+  ExternalProject_Add(apriltags
+    GIT_REPOSITORY https://github.com/psiorx/apriltags-pod.git
+    GIT_TAG ed2972f
+    CMAKE_CACHE_ARGS
+      ${default_cmake_args}
+    )
+
+  ExternalProject_Add(apriltags_driver
+    GIT_REPOSITORY https://github.com/patmarion/apriltags_driver.git
+    GIT_TAG 3d84ae4
+    CMAKE_CACHE_ARGS
+      ${default_cmake_args}
+    DEPENDS
+      ${lcm_depends}
+    )
+
+  set(apriltags_depends apriltags)

 endif()

@@ -412,6 +491,7 @@
     ${eigen_depends}
     ${lcm_depends}
     ${libbot_depends}
+    ${cvutils_depends}
     PythonQt
     ctkPythonConsole
     QtPropertyBrowser


Update android toolchain to support latest ndk 0.8b

--- CMake/toolchain/android.toolchain.cmake
+++ CMake/toolchain/android.toolchain.cmake
@@ -1,5 +1,5 @@
 # ------------------------------------------------------------------------------
-#  Android CMake toolchain file, for use with the Android NDK r5-r8
+#  Android CMake toolchain file, for use with the Android NDK r5-r8b
 #  Requires cmake 2.6.3 or newer (2.8.3 or newer is recommended).
 #  See home page: http://code.google.com/p/android-cmake/
 #
@@ -180,6 +180,10 @@
 #   - modified May 2012
 #     [+] updated for NDK r8
 #     [+] added mips architecture support
+#   - modified July 2012 by ifreedom.cn@gmail.com
+#     [+] updated for NDK r8b
+#     [+] fixed compiler version get
+#     [+] fixed gnu-stl version choose
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
@@ -199,7 +203,7 @@
 #this one not so much
 set( CMAKE_SYSTEM_VERSION 1 )

-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8b -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
 if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
  if( CMAKE_HOST_WIN32 )
   file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
@@ -473,7 +477,8 @@
  foreach( __toolchain ${__availableToolchains} )
   __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK}/toolchains/${__toolchain}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
   if( __machine )
-   string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]+$" __version "${__toolchain}" )
+   string( REGEX MATCH "[0-9]+.[0-9]+(.[0-9]+)?$" __version "${__toolchain}" )
+   string( REGEX MATCH "[0-9]+.[0-9]+(.[0-9]+)?$" __version "${__version}" )
    string( REGEX MATCH "^[^-]+" __arch "${__toolchain}" )
    list( APPEND __availableToolchainMachines ${__machine} )
    list( APPEND __availableToolchainArchs ${__arch} )
@@ -485,6 +490,13 @@
  if( NOT __availableToolchains )
   message( FATAL_ERROR "Could not any working toolchain in the NDK. Probably your Android NDK is broken." )
  endif()
+endif()
+#is ndk r8b?
+list( FIND __availableToolchainCompilerVersions "4.6" __hasGCC46 )
+if( __hasGCC46 EQUAL -1 )
+ set( __hasGCC46 FALSE )
+else()
+ set( __hasGCC46 TRUE )
 endif()

 #build list of available ABIs
@@ -669,8 +681,13 @@
   set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/stlport/stlport" )
   set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/stlport/libs/${ANDROID_NDK_ABI_NAME}" )
  else()
-  set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include" )
-  set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}" )
+  if(__hasGCC46)
+   set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/include" )
+   set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}" )
+  else()
+   set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include" )
+   set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}" )
+  endif()
  endif()
 endif()


Create and set environment variables

Create and set environment variables

Environment variables for bash are written into ~/.sirfrc and
the file is sourced from .bashrc.

Creates a default configuration for Gadgetron after build.

The system is now fully functional after build.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -87,10 +87,17 @@
 #Need to configure main project here.
 #set(proj ${PRIMARY_PROJECT_NAME})

+# SETUP ENVIRONMENT VARIABLES
 # Make environment files
 set(SIRF_SRC_PATH ${CMAKE_CURRENT_LIST_DIR}/SIRF)
 set(CCPPETMR_INSTALL ${SUPERBUILD_INSTALL_DIR})
 configure_file(env_ccppetmr.sh.in ${CCPPETMR_INSTALL}/bin/env_ccppetmr.sh)
+# create .sirfrc
+configure_file(env_ccppetmr.sh.in $ENV{HOME}/.sirfrc)
+# append .sirfrc to .bashrc
+file(APPEND $ENV{HOME}/.bashrc "#Environment variables for SIRF
+source ~/.sirfrc")
 configure_file(env_ccppetmr.csh.in ${CCPPETMR_INSTALL}/bin/env_ccppetmr.csh)
-#default gadgetron configuration
+
+#Create a default Gadgetron configuration
 configure_file(${CCPPETMR_INSTALL}/share/gadgetron/config/gadgetron.xml.example ${CCPPETMR_INSTALL}/share/gadgetron/config/gadgetron.xml)


SVN_SILENT made messages (.desktop file)

--- gstreamer/gstreamer.desktop.cmake
+++ gstreamer/gstreamer.desktop.cmake
@@ -11,7 +11,6 @@

 Name=GStreamer
 Name[bg]=GStreamer
-Name[bs]=Gstreamer
 Name[ca]=GStreamer
 Name[ca@valencia]=GStreamer
 Name[cs]=GStreamer
@@ -66,7 +65,6 @@

 Comment=Phonon GStreamer backend
 Comment[bg]=Phonon GStreamer
-Comment[bs]=Gstreamer kao pozadina Phonona
 Comment[ca]=Dorsal GStreamer del Phonon
 Comment[ca@valencia]=Dorsal GStreamer del Phonon
 Comment[cs]=Podpůrná vrstva GStreamer pro Phonon


Indicate that omnibus_f4sd is constrained in flash

--- boards/omnibus/f4sd/default.cmake
+++ boards/omnibus/f4sd/default.cmake
@@ -6,6 +6,7 @@
 	TOOLCHAIN arm-none-eabi
 	ARCHITECTURE cortex-m4
 	ROMFSROOT px4fmu_common
+	CONSTRAINED_FLASH
 	SERIAL_PORTS
 		TEL2:/dev/ttyS1
 		URT6:/dev/ttyS2


pch changes

pch changes

--- build/build.cmake
+++ build/build.cmake
@@ -41,7 +41,8 @@
   ${BUILD}
 )

-settingsCR(platform)
+settingsCR(platform)
+createPCH(platform)

 target_include_directories(platform PUBLIC "${root}/inc")
 target_link_libraries(platform PUBLIC
@@ -68,7 +69,8 @@
 )

 add_executable(platform_tests
-					${SRCS})
+					${SRCS})
+createPCH(platform_tests)

 target_link_libraries(platform_tests
 	doctest


Fix finding Ogre framework on OS X

Fix finding Ogre framework on OS X

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -69,7 +69,11 @@
 endif ()

-set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}")
+if(APPLE)
+	set(OGRE_LIBRARY_NAMES "Ogre${OGRE_LIB_SUFFIX}")
+else()
+    set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}")
+endif()
 get_debug_names(OGRE_LIBRARY_NAMES)

 # construct search paths from environmental hints and


Fix logic for warning about missing repository version.

The warning message was being displayed when a proper repo existed.

--- CMake/sitkSourceVersion.cmake
+++ CMake/sitkSourceVersion.cmake
@@ -31,19 +31,18 @@

 get_git_head_revision(GIT_REFVAR _GIT_VERSION_HASH)

-# if there is not git directory we should be in a distributed package
+# if there is not a git directory we should be in a distributed package
 # which should contain this additional cmake file with the
 # _GIT_VERSION variables
-if(_GIT_VERSION_HASH STREQUAL "GITDIR-NOTFOUND" AND
-    EXISTS "${CMAKE_CURRENT_LIST_DIR}/sitkSourceVersionVars.cmake" )
-  include( "${CMAKE_CURRENT_LIST_DIR}/sitkSourceVersionVars.cmake" )
+if(_GIT_VERSION_HASH STREQUAL "GITDIR-NOTFOUND")
+    if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/sitkSourceVersionVars.cmake")
+      include( "${CMAKE_CURRENT_LIST_DIR}/sitkSourceVersionVars.cmake" )
+    else()
+      message(WARNING "Unable to determine source version!\n
+Please use the git repository or an official source distribution.\n")
+      set(_GIT_VERSION_DEV "")
+    endif()
   return()
-else()
-  message(WARNING "Unable to determine source version!\n
-Please use the git repository or an official source distribution.\n")
-  set(_GIT_VERSION_DEV "")
-  return()
-
 endif()

 if(_GIT_VERSION_HASH MATCHES "[a-fA-F0-9]+")


Find Macros: Reformat CMake code

Find Macros: Reformat CMake code

--- cmake/Modules/LibFindMacros.cmake
+++ cmake/Modules/LibFindMacros.cmake
@@ -3,11 +3,9 @@
 		if (NOT EXISTS ${PKG_CONFIG_EXECUTABLE})
 			set (${OUT_VARIABLE} "")
 		else ()
-			execute_process (
-				COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${PKG_VARIABLE} ${MODULE}
-				OUTPUT_VARIABLE ${OUT_VARIABLE}
-				OUTPUT_STRIP_TRAILING_WHITESPACE
-		)
+			execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${PKG_VARIABLE} ${MODULE}
+					 OUTPUT_VARIABLE ${OUT_VARIABLE}
+					 OUTPUT_STRIP_TRAILING_WHITESPACE)
 		endif ()
 	endmacro (pkg_get_variable)
 endif ()


Fix for ROOT-8510 - CMake: default config on MacOS fails due to fortran

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -9,6 +9,9 @@
     set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)
   endif()
   enable_language(Fortran OPTIONAL)
+  if(NOT CMAKE_Fortran_COMPILER)
+    set(CMAKE_Fortran_COMPILER_LOADED)   # FindBLAS/LAPACK tests CMAKE_Fortran_COMPILER_LOADED
+  endif()
 else()
   set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)
 endif()


cmake: Force decompression even if file already exists on make distcheck.

--- cmake/modules/TelepathyDist.cmake
+++ cmake/modules/TelepathyDist.cmake
@@ -6,7 +6,7 @@
 # setup make distcheck
 add_custom_target(distcheck cd ${CMAKE_BINARY_DIR} &&
                         rm -rf ${PACKAGE_NAME}-${PACKAGE_VERSION} &&
-                        gzip -d ${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz &&
+                        gzip -df ${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz &&
                         tar -xf ${PACKAGE_NAME}-${PACKAGE_VERSION}.tar &&
                         cd ${PACKAGE_NAME}-${PACKAGE_VERSION}/ &&
                         cmake . && make && make test && make doxygen-doc &&


added hunter version 1.6.0

added hunter version 1.6.0

--- cmake/projects/cnats/hunter.cmake
+++ cmake/projects/cnats/hunter.cmake
@@ -17,6 +17,17 @@
     2ACCBEABE5FD3CC52EB15D6403E0C3EFF06DD849
 )

+hunter_add_version(
+    PACKAGE_NAME
+    cnats
+    VERSION
+    "1.6.0"
+    URL
+    "https://github.com/nats-io/cnats/archive/v1.6.0.tar.gz"
+    SHA1
+    E3B459797092BE186E1BD4FFB84F92AB6C482EF4
+)
+
 # Probably more versions for real packages...

 # Pick a download scheme
@@ -26,4 +37,4 @@
 # Two versions of library will be build by default:
 #     * libexample_A.a
 #     * libexample_Ad.a
-hunter_download(PACKAGE_NAME cnats)+hunter_download(PACKAGE_NAME cnats)