GLOBAL_SET(BoostOrg_INCLUDE_DIRS "${Boost_INCLUDE_DIRS}")
GLOBAL_SET(BoostOrg_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}")

TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES(
  BoostOrg
  REQUIRED_HEADERS boost/property_tree/json_parser.hpp
                   boost/property_tree/ptree.hpp
                   boost/math/tools/polynomial.hpp
                   boost/math/tools/rational.hpp
                   boost/geometry.hpp
                   boost/range.hpp
                   boost/program_options.hpp
  REQUIRED_LIBS_NAMES boost_program_options
  )

# Use CMake FindBoost module to check version is sufficient
SET(BOOST_INCLUDEDIR ${TPL_BoostOrg_INCLUDE_DIRS})
SET(Boost_NO_SYSTEM_PATHS ON)
FIND_PACKAGE(Boost 1.61.0 REQUIRED)

GLOBAL_SET(BoostOrg_INCLUDE_DIRS "${Boost_INCLUDE_DIRS}")
GLOBAL_SET(BoostOrg_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}")

TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES(
  BoostOrg
  REQUIRED_HEADERS boost/property_tree/json_parser.hpp
                   boost/property_tree/ptree.hpp
                   boost/math/tools/polynomial.hpp
                   boost/math/tools/rational.hpp
                   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
SET(BOOST_INCLUDEDIR ${TPL_BoostOrg_INCLUDE_DIRS})
SET(Boost_NO_SYSTEM_PATHS ON)
FIND_PACKAGE(Boost 1.61.0 REQUIRED)

Add Boost.Test to the list of TPLs

Add Boost.Test to the list of TPLs


# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>

find_program(VALA_EXECUTABLE NAMES $ENV{VALAC} valac)
if (VALA_EXECUTABLE)
    execute_process(COMMAND ${VALA_EXECUTABLE} "--version" OUTPUT_VARIABLE "VALA_VERSION")
    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")
endif ()

macro(vala_require VALA_REQUIRED)
    if (${VALA_VERSION} VERSION_GREATER ${VALA_REQUIRED} OR ${VALA_VERSION} VERSION_EQUAL ${VALA_REQUIRED})
        message(STATUS "valac ${VALA_VERSION} found")
    else ()
        message(FATAL_ERROR "valac >= ${VALA_REQUIRED} or later required")
    endif ()
endmacro(vala_require)

# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>

find_program(VALA_EXECUTABLE NAMES $ENV{VALAC} valac)
if (VALA_EXECUTABLE)
    execute_process(COMMAND ${VALA_EXECUTABLE} "--version" OUTPUT_VARIABLE "VALA_VERSION")
    string(REPLACE "Vala " "" VALA_VERSION ${VALA_VERSION})
    string(STRIP ${VALA_VERSION} VALA_VERSION)
else ()
    message(FATAL_ERROR "valac not found - install Vala compiler or specify compiler name eg. VALAC=valac-0.20")
endif ()

macro(vala_require VALA_REQUIRED)
    if (${VALA_VERSION} VERSION_GREATER ${VALA_REQUIRED} OR ${VALA_VERSION} VERSION_EQUAL ${VALA_REQUIRED})
        message(STATUS "valac ${VALA_VERSION} found")
    else ()
        message(FATAL_ERROR "valac >= ${VALA_REQUIRED} or later required")
    endif ()
endmacro(vala_require)

Clarify suggestion to install Vala or specify the version


option(WITH_LIBZ "Build with ZLIB support" ON)
option(WITH_SSH1 "Build with SSH1 support" OFF)
option(WITH_SFTP "Build with SFTP support" ON)
option(WITH_SERVER "Build with SSH server support" ON)
option(WITH_STATIC_LIB "Build with a static library" OFF)
option(WITH_DEBUG_CRYPTO "Build with cryto debug output" OFF)
option(WITH_DEBUG_CALLTRACE "Build with calltrace debug output" ON)
option(WITH_GCRYPT "Compile against libgcrypt" OFF)
option(WITH_PCAP "Compile with Pcap generation support" ON)
option(WITH_INTERNAL_DOC "Compile doxygen internal documentation" OFF)
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_TESTING)
  set(WITH_STATIC_LIB ON)
endif (WITH_TESTING)
if(WITH_BENCHMARKS)
  set(WITH_TESTING ON)
endif(WITH_BENCHMARKS)

option(WITH_LIBZ "Build with ZLIB support" ON)
option(WITH_SSH1 "Build with SSH1 support" OFF)
option(WITH_SFTP "Build with SFTP support" ON)
option(WITH_SERVER "Build with SSH server support" ON)
option(WITH_STATIC_LIB "Build with a static library" OFF)
option(WITH_DEBUG_CRYPTO "Build with cryto debug output" OFF)
option(WITH_DEBUG_CALLTRACE "Build with calltrace debug output" ON)
option(WITH_GCRYPT "Compile against libgcrypt" OFF)
option(WITH_PCAP "Compile with Pcap generation support" ON)
option(WITH_INTERNAL_DOC "Compile doxygen internal documentation" OFF)
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)

Set variables in the good order

Set variables in the good order


# SPDX-License-Identifier: BSD-2-Clause
cmake_minimum_required(VERSION 3.2)

set(
   KERNEL_NOARCH_SOURCES_GLOB

   "${CMAKE_SOURCE_DIR}/kernel/*.c"
   "${CMAKE_SOURCE_DIR}/kernel/*/*.c"
   "${CMAKE_SOURCE_DIR}/kernel/fs/*/*.c"
   "${CMAKE_SOURCE_DIR}/common/*.c"
   "${CMAKE_SOURCE_DIR}/common/3rd_party/datetime.c"
   "${CMAKE_SOURCE_DIR}/common/3rd_party/crc32.c"
)

if (KERNEL_SELFTESTS)
   list(
      APPEND
      KERNEL_NOARCH_SOURCES_GLOB
      "${CMAKE_SOURCE_DIR}/tests/self/*.c"
   )
endif()

file(GLOB KERNEL_NOARCH_SOURCES ${KERNEL_NOARCH_SOURCES_GLOB})

# SPDX-License-Identifier: BSD-2-Clause
cmake_minimum_required(VERSION 3.2)

set(
   KERNEL_NOARCH_SOURCES_GLOB

   "${CMAKE_SOURCE_DIR}/kernel/*.c"
   "${CMAKE_SOURCE_DIR}/kernel/*.cpp"
   "${CMAKE_SOURCE_DIR}/kernel/*/*.c"
   "${CMAKE_SOURCE_DIR}/kernel/*/*.cpp"
   "${CMAKE_SOURCE_DIR}/kernel/fs/*/*.c"
   "${CMAKE_SOURCE_DIR}/kernel/fs/*/*.cpp"
   "${CMAKE_SOURCE_DIR}/common/*.c"
   "${CMAKE_SOURCE_DIR}/common/3rd_party/datetime.c"
   "${CMAKE_SOURCE_DIR}/common/3rd_party/crc32.c"
)

if (KERNEL_SELFTESTS)
   list(
      APPEND
      KERNEL_NOARCH_SOURCES_GLOB
      "${CMAKE_SOURCE_DIR}/tests/self/*.c"
   )
endif()

file(GLOB KERNEL_NOARCH_SOURCES ${KERNEL_NOARCH_SOURCES_GLOB})

[cmake] Allow C++ files also in the kernel/ directory


# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Try to find the Check libraries (Unit test framework for C)

include(FindPackageHandleStandardArgs)

find_path(CHECK_INCLUDE_DIRS NAMES check.h)
find_library(CHECK_LIBRARIES NAMES check)

list(APPEND CHECK_LIBRARIES rt)
list(APPEND CHECK_LIBRARIES m)
list(APPEND CHECK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})

FIND_PACKAGE_HANDLE_STANDARD_ARGS(Check
	REQUIRED_VARS CHECK_LIBRARIES CHECK_INCLUDE_DIRS)

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Try to find the Check libraries (Unit test framework for C)

include(FindPackageHandleStandardArgs)

find_path(CHECK_INCLUDE_DIRS NAMES check.h)
find_library(CHECK_LIBRARIES NAMES check)
find_package(Threads REQUIRED)

list(APPEND CHECK_LIBRARIES rt)
list(APPEND CHECK_LIBRARIES m)
list(APPEND CHECK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})

FIND_PACKAGE_HANDLE_STANDARD_ARGS(Check
	REQUIRED_VARS CHECK_LIBRARIES CHECK_INCLUDE_DIRS)

Fix check dependency to pthread

Fix check dependency to pthread

This break compilation on debian jessie.


# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "474dd81679425f04fa0894fcd094afbab4c22311")

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

# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "3da45bce8f1178f33be211861a7848ab3993d9b9")

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

Update FW with fixes for newer OAK-D

Update FW with fixes for newer OAK-D


# ITK version number components.
set(ITK_VERSION_MAJOR "5")
set(ITK_VERSION_MINOR "1")
set(ITK_VERSION_PATCH "0")

# ITK version number components.
set(ITK_VERSION_MAJOR "5")
set(ITK_VERSION_MINOR "1")
set(ITK_VERSION_PATCH "1")

Update ITK CMake version for 5.1.1

ENH: Update ITK CMake version for 5.1.1


# toolchain-parallax_p8x32a
#
# Copyright 2017 Andrew Countryman <apcountryman@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
# file except in compliance with the License. You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the specific language governing
# permissions and limitations under the License.

# File: CMakeCOGCXXInformation.cmake
# Description: Set up rule variables for COG C++.

message( STATUS "CMakeCOGCXXInformation.cmake" )

set( CMAKE_COGCXX_OUTPUT_EXTENSION .cog )

# toolchain-parallax_p8x32a
#
# Copyright 2017 Andrew Countryman <apcountryman@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
# file except in compliance with the License. You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the specific language governing
# permissions and limitations under the License.

# File: CMakeCOGCXXInformation.cmake
# Description: Set up rule variables for COG C++.

message( STATUS "CMakeCOGCXXInformation.cmake" )

# object extension
set( CMAKE_COGCXX_OUTPUT_EXTENSION .cog )

# object compilation
set(
    CMAKE_COGCXX_COMPILE_OBJECT
    "<CMAKE_COGCXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> <SOURCE>"
)

Add object compilation rule for COGCXX

Add object compilation rule for COGCXX


# Copyright (c) 2011 Stefan Eilemann <eile@eyescale.ch>

FUNCTION(EQ_COMPILER_DUMPVERSION OUTPUT_VERSION)
  EXECUTE_PROCESS(COMMAND
    ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
    OUTPUT_VARIABLE EQ_COMPILER_VERSION
  )
  STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
    EQ_COMPILER_VERSION ${EQ_COMPILER_VERSION})

  SET(${OUTPUT_VERSION} ${EQ_COMPILER_VERSION} PARENT_SCOPE)
ENDFUNCTION()

# Copyright (c) 2011 Stefan Eilemann <eile@eyescale.ch>

FUNCTION(EQ_COMPILER_DUMPVERSION OUTPUT_VERSION)
  EXECUTE_PROCESS(COMMAND
    ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
    OUTPUT_VARIABLE EQ_COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
  )
  STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
    EQ_COMPILER_VERSION ${EQ_COMPILER_VERSION})

  SET(${OUTPUT_VERSION} ${EQ_COMPILER_VERSION} PARENT_SCOPE)
ENDFUNCTION()

Remove newline in CMake output

Remove newline in CMake output

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


# Set Diffusion specific CPack options

set(CPACK_PACKAGE_EXECUTABLES "mitkDiffusion;MITK Diffusion")
set(CPACK_PACKAGE_NAME "MITK-Diffusion")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MITK application for processing of MR diffusion imaging data.")
# Major version is the year of release
set(CPACK_PACKAGE_VERSION_MAJOR "2012")
# Minor version is the month of release
set(CPACK_PACKAGE_VERSION_MINOR "")
# Patch versioning is not intended to be done
set(CPACK_PACKAGE_VERSION_PATCH "")

# this should result in names like 2011.09, 2012.06, ...
# version has to be set explicitly to avoid such things as CMake creating the install directory "MITK Diffusion 2011.."
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")

if(CMAKE_CL_64)
  set(CPACK_PACKAGE_FILE_NAME "MITK-Diffusion-${CPACK_PACKAGE_VERSION}-win64")
elseif(MINGW)
  set(CPACK_PACKAGE_FILE_NAME "MITK-Diffusion-${CPACK_PACKAGE_VERSION}-mingw32")
elseif(WIN32)
  set(CPACK_PACKAGE_FILE_NAME "MITK-Diffusion-${CPACK_PACKAGE_VERSION}-win32")
else()
  set(CPACK_PACKAGE_FILE_NAME "MITK-Diffusion-${CPACK_PACKAGE_VERSION}")
endif()

# Set Diffusion specific CPack options

set(CPACK_PACKAGE_EXECUTABLES "mitkDiffusion;MITK Diffusion")
set(CPACK_PACKAGE_NAME "MITK-Diffusion")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MITK application for processing of MR diffusion imaging data.")
# Major version is the year of release
set(CPACK_PACKAGE_VERSION_MAJOR "2012")
# Minor version is the month of release
set(CPACK_PACKAGE_VERSION_MINOR "09")
# Patch versioning is not intended to be done
set(CPACK_PACKAGE_VERSION_PATCH "")

# this should result in names like 2011.09, 2012.06, ...
# version has to be set explicitly to avoid such things as CMake creating the install directory "MITK Diffusion 2011.."
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")

if(CMAKE_CL_64)
  set(CPACK_PACKAGE_FILE_NAME "MITK-Diffusion-${CPACK_PACKAGE_VERSION}-win64")
elseif(MINGW)
  set(CPACK_PACKAGE_FILE_NAME "MITK-Diffusion-${CPACK_PACKAGE_VERSION}-mingw32")
elseif(WIN32)
  set(CPACK_PACKAGE_FILE_NAME "MITK-Diffusion-${CPACK_PACKAGE_VERSION}-win32")
else()
  set(CPACK_PACKAGE_FILE_NAME "MITK-Diffusion-${CPACK_PACKAGE_VERSION}")
endif()

Set minor version to month

Set minor version to month


# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "4e63bce52514acfb7e808ffd6b9134b6868652be")

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

# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "22f00aeeec005de80c99084b23291a9f154bb84f")

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

Update FW with clock related tweaks for feature tracker


#####
##
## Copyright (C) 2012 by the deal.II authors
##
## This file is part of the deal.II library.
##
## <TODO: Full License information>
## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
## version of the LGPL license.
##
## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
##
#####

#
# Remove all occurences of "${flag}" in the string variable.
#
# Usage:
#     STRIP_FLAG(variable flag)
#

MACRO(STRIP_FLAG _variable _flag)
  SET(${_variable} " ${${_variable}} ")
  STRING(REPLACE " " "  " "${_variable}" ${${_variable}})
  STRING(REPLACE " ${_flag} " "" "${_variable}" ${${_variable}})
  STRING(REPLACE "  " " " "${_variable}" ${${_variable}})
  STRING(STRIP "${${_variable}}" ${_variable})
ENDMACRO()

#####
##
## Copyright (C) 2012 by the deal.II authors
##
## This file is part of the deal.II library.
##
## <TODO: Full License information>
## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
## version of the LGPL license.
##
## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
##
#####

#
# Remove all occurences of "${flag}" in the string variable.
#
# Usage:
#     STRIP_FLAG(variable flag)
#

MACRO(STRIP_FLAG _variable _flag)
  SET(${_variable} "${${_variable}} ")
  STRING(REPLACE "${_flag} " "" "${_variable}" ${${_variable}})
  STRING(STRIP "${${_variable}}" ${_variable})
ENDMACRO()

Revert "What a bummer. Fix it properly..."

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


SET(XMP_SEARCH_PATHS
    /usr/local/
    /usr
    /opt
)

FIND_PATH(XMP_INCLUDE_DIR xmp.h
    HINTS ${XMP_ROOT}
    PATH_SUFFIXES include
    PATHS ${XMP_SEARCH_PATHS}
)
FIND_LIBRARY(XMP_LIBRARY xmp
    HINTS ${XMP_ROOT}
    PATH_SUFFIXES lib64 lib
    PATHS ${XMP_SEARCH_PATHS}
)

IF(XMP_INCLUDE_DIR AND XMP_LIBRARY)
   SET(XMP_FOUND TRUE)
ENDIF()

IF(XMP_FOUND)
    MESSAGE(STATUS "Found libxmp: ${XMP_LIBRARY}")
ELSE()
    MESSAGE(WARNING "Could not find libxmp")
ENDIF()

SET(XMP_SEARCH_PATHS
    /usr/local/
    /usr
    /opt
)

FIND_PATH(XMP_INCLUDE_DIR xmp.h
    HINTS ${XMP_ROOT}
    PATH_SUFFIXES include
    PATHS ${XMP_SEARCH_PATHS}
)
FIND_LIBRARY(XMP_LIBRARY xmp xmp_dll
    HINTS ${XMP_ROOT}
    PATH_SUFFIXES lib64 lib
    PATHS ${XMP_SEARCH_PATHS}
)

IF(XMP_INCLUDE_DIR AND XMP_LIBRARY)
   SET(XMP_FOUND TRUE)
ENDIF()

IF(XMP_FOUND)
    MESSAGE(STATUS "Found libxmp: ${XMP_LIBRARY}")
ELSE()
    MESSAGE(WARNING "Could not find libxmp")
ENDIF()

Allow xmp finder script to look for xml dll library


# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "c5303ecec4c30a752a7f362589239b9d1784a0d3")

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

# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "a61df0cda79ec82a665dbf236de74b9aa2c096e4")

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

Update FW, for depthai-shared to match with depthai-core


# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "bf0a337613d82ad97f13b1cf2b6e99e4d8ae7032")

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

# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "99b34ec1ca0635bb9e55c570b907a67eafa5fe19")

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

Update FW with multi instance support

Update FW with multi instance support


# FFTW
OPTION(NEKTAR_USE_FFTW
    "Use FFTW routines for performing the Fast Fourier Transform." OFF)

CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_FFTW
    "Build FFTW from ThirdParty" OFF
    "NEKTAR_USE_FFTW" OFF)

IF( NEKTAR_USE_FFTW )
    IF (THIRDPARTY_BUILD_FFTW)
        INCLUDE(ExternalProject)

        EXTERNALPROJECT_ADD(
            fftw-3.2.2
            URL ${TPURL}/fftw-3.2.2.tar.gz
            URL_MD5 "b616e5c91218cc778b5aa735fefb61ae"
            STAMP_DIR ${TPSRC}/stamp
            DOWNLOAD_DIR ${TPSRC}
            SOURCE_DIR ${TPSRC}/fftw-3.2.2
            BINARY_DIR ${TPBUILD}/fftw-3.2.2
            TMP_DIR ${TPBUILD}/fftw-3.2.2-tmp
            INSTALL_DIR ${TPDIST}
            CONFIGURE_COMMAND ${TPSRC}/fftw-3.2.2/configure --prefix=${TPDIST} --quiet --enable-shared --disable-dependency-tracking
        )
        SET(FFTW_LIB fftw3)
        MARK_AS_ADVANCED(FFTW_LIB)
        INCLUDE_DIRECTORIES(${TPDIST}/include)
        MESSAGE(STATUS "Build FFTW: ${TPDIST}/lib/lib${FFTW_LIB}.so")
    ELSE ()
        INCLUDE (FindFFTW)
    ENDIF()
ENDIF( NEKTAR_USE_FFTW )

# FFTW
OPTION(NEKTAR_USE_FFTW
    "Use FFTW routines for performing the Fast Fourier Transform." OFF)

CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_FFTW
    "Build FFTW from ThirdParty" OFF
    "NEKTAR_USE_FFTW" OFF)

IF( NEKTAR_USE_FFTW )
    IF (THIRDPARTY_BUILD_FFTW)
        INCLUDE(ExternalProject)

        EXTERNALPROJECT_ADD(
            fftw-3.2.2
            URL ${TPURL}/fftw-3.2.2.tar.gz
            URL_MD5 "b616e5c91218cc778b5aa735fefb61ae"
            STAMP_DIR ${TPSRC}/stamp
            DOWNLOAD_DIR ${TPSRC}
            SOURCE_DIR ${TPSRC}/fftw-3.2.2
            BINARY_DIR ${TPBUILD}/fftw-3.2.2
            TMP_DIR ${TPBUILD}/fftw-3.2.2-tmp
            INSTALL_DIR ${TPDIST}
            CONFIGURE_COMMAND ${TPSRC}/fftw-3.2.2/configure --prefix=${TPDIST} --quiet --enable-shared --disable-dependency-tracking
        )
        SET(FFTW_LIB fftw3)
        MARK_AS_ADVANCED(FFTW_LIB)
	SET(FFTW_INCLUDE_DIR ${TPDIST}/include)
        MESSAGE(STATUS "Build FFTW: ${TPDIST}/lib/lib${FFTW_LIB}.so")
    ELSE ()
        INCLUDE (FindFFTW)
    ENDIF()
ENDIF( NEKTAR_USE_FFTW )

Fix to FFTW cmake to build on cx2

Fix to FFTW cmake to build on cx2


if(${MSVC})
    # Enable debug info in Release.
    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi")
    set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /debug")
elseif(${UNIX})
    # These are all required on Xcode 4.5.1 + iOS, because the defaults are no good.
    set(CMAKE_C_FLAGS "-pthread -g")
    set(CMAKE_CXX_FLAGS "-pthread -g")
    set(CMAKE_C_FLAGS_DEBUG "-O0")
    set(CMAKE_CXX_FLAGS_DEBUG "-O0")
    set(CMAKE_C_FLAGS_RELEASE "-Os")
    set(CMAKE_CXX_FLAGS_RELEASE "-Os")
endif()

if(${IOS})
    set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
    set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
endif()

if(${MSVC})
    # Enable debug info in Release.
    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi")
    set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /debug")
elseif(${UNIX})
    if(${CYGWIN})
        set(CMAKE_C_FLAGS "-g")
        set(CMAKE_CXX_FLAGS "-g")
    else()
        # These are all required on Xcode 4.5.1 + iOS, because the defaults are no good.
        set(CMAKE_C_FLAGS "-pthread -g")
        set(CMAKE_CXX_FLAGS "-pthread -g")
    endif()
    set(CMAKE_C_FLAGS_DEBUG "-O0")
    set(CMAKE_CXX_FLAGS_DEBUG "-O0")
    set(CMAKE_C_FLAGS_RELEASE "-Os")
    set(CMAKE_CXX_FLAGS_RELEASE "-Os")
endif()

if(${IOS})
    set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
    set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
endif()

Remove -pthread option on Cygwin

Remove -pthread option on Cygwin


# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "7f7e0e7aa2d705d8e618605800fd3c2447a866dd")

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

# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "d1086bf51f6aa5a75c9afcda34c74c62e4e9a53b")

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

Update FW: fix overriding useHomographyRectification behaviour specified in docs when custom mesh is provided


#---------------------------------------------------------------------------
# Get a Python with the itk package installed on Windows or create a
# virtualenv to install the ITK package on Linux or Mac

if(WIN32)
  # python.org 64 bit Windows Python with the itk and sphinx packages installed
  # Todo: needs update
  message(FATAL_ERROR "ITKExamples_USE_WRAP_PYTHON without PYTHON_EXECUTABLE set is currently not supported on Windows.")
  set(_itk_python_dir "${CMAKE_CURRENT_BINARY_DIR}/itkpython")
  set(ITKPYTHON_EXECUTABLE "${_itk_python_dir}/python.exe" CACHE FILEPATH "Python executable with the ITK package installed" FORCE)
  ExternalProject_Add(ITKPython
    URL "https://data.kitware.com/api/v1/file/58c760808d777f0aef5d798e/download"
    URL_MD5 "440580cec3b86903da26f0246637024f"
    DOWNLOAD_NAME itkpython.zip
    DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
    SOURCE_DIR ${_itk_python_dir}
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ""
    )
else()
  find_package(PythonInterp REQUIRED)

  set(_virtualenv_version 15.0.1)
  set(_virtualenv_SOURCE_DIR "virtualenv-${_virtualenv_version}")
  set(_virtualenv_script "${CMAKE_CURRENT_BINARY_DIR}/${_virtualenv_SOURCE_DIR}/virtualenv.py")
  set(_itk_venv "${CMAKE_CURRENT_BINARY_DIR}/itkpython")
  set(ITKPYTHON_EXECUTABLE "${_itk_venv}/bin/python" CACHE FILEPATH "Python executable with the ITK package installed" FORCE)
  ExternalProject_Add(ITKPython
    URL "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-${_virtualenv_version}.tar.gz"
    URL_MD5 "28d76a0d9cbd5dc42046dd14e76a6ecc"
    DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
    SOURCE_DIR ${_virtualenv_SOURCE_DIR}
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ${PYTHON_EXECUTABLE} "${_virtualenv_script}" "${_itk_venv}"
    INSTALL_COMMAND ${ITKPYTHON_EXECUTABLE} -m pip install --pre itk sphinx
    )
endif()

find_package(PythonInterp 3 REQUIRED)

set(_itk_venv "${CMAKE_CURRENT_BINARY_DIR}/itkpython")
if(WIN32)
  set(ITKPYTHON_EXECUTABLE "${_itk_venv}/python.exe" CACHE FILEPATH "Python executable with the ITK package installed" FORCE)
else()
  set(ITKPYTHON_EXECUTABLE "${_itk_venv}/bin/python" CACHE FILEPATH "Python executable with the ITK package installed" FORCE)
endif()

ExternalProject_Add(ITKPython
  DOWNLOAD_COMMAND ""
  CONFIGURE_COMMAND ""
  BUILD_COMMAND ${PYTHON_EXECUTABLE} -m venv "${_itk_venv}"
  INSTALL_COMMAND ${ITKPYTHON_EXECUTABLE} -m pip install --pre itk sphinx
  )

Use Python 3 venv in the superbuild

ENH: Use Python 3 venv in the superbuild


if (NOT EXISTS ${CMAKE_BINARY_DIR}/external/googletest)
  message("--googletest not found. Installing")
  ExternalProject_Add(googletest
    GIT_REPOSITORY "https://github.com/google/googletest.git"
    GIT_TAG "release-1.8.0"
    PREFIX external/googletest
    BUILD_IN_SOURCE
    UPDATE_COMMAND ""
    CMAKE_CACHE_ARGS
      -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
      -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
      -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
      -DBUILD_GMOCK:BOOL=OFF
      -DBUILD_GTEST:BOOL=ON
      -DCMAKE_BUILD_TYPE:STRING=Debug
  )
endif()

set(GTEST_ROOT ${CMAKE_BINARY_DIR}/external/googletest)
set(env(GTEST_ROOT) ${CMAKE_BINARY_DIR}/external/googletest)

if (NOT EXISTS ${CMAKE_BINARY_DIR}/external/googletest)
  message("--googletest not found. Installing")

  ExternalProject_Add(googletest-release
    GIT_REPOSITORY "https://github.com/google/googletest.git"
    GIT_TAG "release-1.8.0"
    PREFIX external/googletest
    BUILD_IN_SOURCE
    UPDATE_COMMAND ""
    CMAKE_CACHE_ARGS
      -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
      -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
      -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
      -DBUILD_GMOCK:BOOL=OFF
      -DBUILD_GTEST:BOOL=ON
      -DCMAKE_BUILD_TYPE:STRING=Release
  )

  ExternalProject_Add(googletest-debug
    GIT_REPOSITORY "https://github.com/google/googletest.git"
    GIT_TAG "release-1.8.0"
    PREFIX external/googletest
    BUILD_IN_SOURCE
    UPDATE_COMMAND ""
    CMAKE_CACHE_ARGS
     -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
     -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
     -DBUILD_GMOCK:BOOL=OFF
     -DBUILD_GTEST:BOOL=ON
     -DCMAKE_BUILD_TYPE:STRING=Debug
     -DCMAKE_DEBUG_POSTFIX:STRING=d
 )
endif()

set(GTEST_ROOT ${CMAKE_BINARY_DIR}/external/googletest)
set(env(GTEST_ROOT) ${CMAKE_BINARY_DIR}/external/googletest)

Support both debug and release versions of GTest


# QT4_GENERATE_MOCS(inputfiles ... )

macro (QT4_GENERATE_MOCS)

  foreach (fileIt ${ARGN})
    QT4_GENERATE_MOC( ${fileIt} moc_${fileIt})
    macro_add_file_dependencies(${fileIt} moc_${fileIt})
  endforeach()

endmacro()

# QT4_GENERATE_MOCS(inputfile1 [inputfile2 ...])

macro(QT4_GENERATE_MOCS)
  foreach(file ${ARGN})
    set(moc_file moc_${file})
    QT4_GENERATE_MOC(${file} ${moc_file})
    macro_add_file_dependencies(${file} ${CMAKE_CURRENT_BINARY_DIR}/${moc_file})
  endforeach()
endmacro()

Fix QT4_GENERATE_MOCS by referencing the moc'ed file with its absolute path


# find speech-dispatcher library and header if available
# Copyright (c) 2009, Jeremy Whiting <jeremy@scitools.com>
# Copyright (c) 2011, Raphael Kubo da Costa <kubito@gmail.com>
# This module defines
#  SPEECHD_INCLUDE_DIR, where to find libspeechd.h
#  SPEECHD_LIBRARIES, the libraries needed to link against speechd
#  SPEECHD_FOUND, If false, speechd was not found
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

find_path(SPEECHD_INCLUDE_DIR libspeechd.h)

find_library(SPEECHD_LIBRARIES NAMES speechd)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Speechd REQUIRED_VARS SPEECHD_INCLUDE_DIR SPEECHD_LIBRARIES)

# find speech-dispatcher library and header if available
# Copyright (c) 2009, Jeremy Whiting <jeremy@scitools.com>
# Copyright (c) 2011, Raphael Kubo da Costa <kubito@gmail.com>
# This module defines
#  SPEECHD_INCLUDE_DIR, where to find libspeechd.h
#  SPEECHD_LIBRARIES, the libraries needed to link against speechd
#  SPEECHD_FOUND, If false, speechd was not found
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

find_path(SPEECHD_INCLUDE_DIR libspeechd.h PATH_SUFFIXES speech-dispatcher)

find_library(SPEECHD_LIBRARIES NAMES speechd)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Speechd REQUIRED_VARS SPEECHD_INCLUDE_DIR SPEECHD_LIBRARIES)

Support for Speechd 0.8 in CMake

Support for Speechd 0.8 in CMake


include(FetchContent)

FetchContent_Declare(range-v3
    GIT_REPOSITORY https://github.com/ericniebler/range-v3.git
    GIT_SHALLOW True)

find_package(range-v3 0.3.6 QUIET)
if(NOT range-v3_FOUND)
    FetchContent_GetProperties(range-v3)
    if(NOT range-v3_POPULATED)
        FetchContent_Populate(range-v3)
        add_subdirectory(${range-v3_SOURCE_DIR} ${range-v3_BINARY_DIR})
    endif()
endif()

if(range-v3_FOUND)
    set(JEGP_DEPENDENCIES_IMPORTED TRUE)
endif()

include(FetchContent)

FetchContent_Declare(range-v3
    GIT_REPOSITORY https://github.com/ericniebler/range-v3.git
    GIT_SHALLOW True)

FetchContent_GetProperties(range-v3)
if(NOT range-v3_POPULATED)
    find_package(range-v3 0.3.6 QUIET)
    if(NOT range-v3_FOUND)
        FetchContent_Populate(range-v3)
        add_subdirectory(${range-v3_SOURCE_DIR} ${range-v3_BINARY_DIR})
    endif()
endif()

if(range-v3_FOUND)
    set(JEGP_DEPENDENCIES_IMPORTED TRUE)
endif()

Check for population before finding package

Prevents exporting the library if downstream populates before using `find_package`.


# Find FCL
#
# This sets the following variables:
# FCL_FOUND
# FCL_INCLUDE_DIRS
# FCL_LIBRARIES

find_package(PkgConfig QUIET)

pkg_check_modules(PC_FCL fcl)
find_path(FCL_INCLUDE_DIR fcl/collision.h
    HINTS ${PC_FCL_INCLUDEDIR}
    PATHS "${CMAKE_INSTALL_PREFIX}/include")

set(FCL_INCLUDE_DIRS ${FCL_INCLUDE_DIR})

if(MSVC)
    set(FCL_LIBRARIES optimized fcl ccd debug fcld ccdd)
else()
    find_library(FCL_LIBRARY fcl)
    find_library(CCD_LIBRARY ccd)
    set(FCL_LIBRARIES ${FCL_LIBRARY} ${CCD_LIBRARY})
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FCL DEFAULT_MSG FCL_INCLUDE_DIR)

mark_as_advanced(FCL_INCLUDE_DIR FCL_LIBRARY CCD_LIBRARY)

# Find FCL
#
# This sets the following variables:
# FCL_FOUND
# FCL_INCLUDE_DIRS
# FCL_LIBRARIES

find_package(PkgConfig QUIET)

pkg_check_modules(PC_FCL fcl)
find_path(FCL_INCLUDE_DIR fcl/collision.h
    HINTS ${PC_FCL_INCLUDEDIR}
    PATHS "${CMAKE_INSTALL_PREFIX}/include")

set(FCL_INCLUDE_DIRS ${FCL_INCLUDE_DIR})

if(MSVC)
    set(FCL_LIBRARIES optimized fcl optimized ccd debug fcld debug ccdd)
else()
    find_library(FCL_LIBRARY fcl)
    find_library(CCD_LIBRARY ccd)
    set(FCL_LIBRARIES ${FCL_LIBRARY} ${CCD_LIBRARY})
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FCL DEFAULT_MSG FCL_INCLUDE_DIR)

mark_as_advanced(FCL_INCLUDE_DIR FCL_LIBRARY CCD_LIBRARY)

Fix referring to debug version libraries for ccd and assimp on Windows


# Try to find Mesa off-screen library and include dir.
# Once done this will define
#
# OSMESA_FOUND        - true if OSMesa has been found
# OSMESA_INCLUDE_DIR  - where the GL/osmesa.h can be found
# OSMESA_LIBRARY      - Link this to use OSMesa

if(NOT OSMESA_INCLUDE_DIR)
  find_path(OSMESA_INCLUDE_DIR GL/osmesa.h
    /usr/openwin/share/include
    /opt/graphics/OpenGL/include
  )
endif()

# This may be left blank if OSMesa symbols are included
# in the main Mesa library
if(NOT OSMESA_LIBRARY)
  find_library(OSMESA_LIBRARY OSMesa
    /opt/graphics/OpenGL/lib
    /usr/openwin/lib
  )
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OSMesa  DEFAULT_MSG  OSMESA_LIBRARY  OSMESA_INCLUDE_DIR)

mark_as_advanced(OSMESA_INCLUDE_DIR OSMESA_LIBRARY)

# Try to find Mesa off-screen library and include dir.
# Once done this will define
#
# OSMESA_FOUND        - true if OSMesa has been found
# OSMESA_INCLUDE_DIR  - where the GL/osmesa.h can be found
# OSMESA_LIBRARY      - Link this to use OSMesa

if(NOT OSMESA_INCLUDE_DIR)

  # If we have a root defined look there first
  if(OSMESA_ROOT)
    find_path(OSMESA_INCLUDE_DIR GL/osmesa.h PATHS ${OSMESA_ROOT}/include
      NO_DEFAULT_PATH
    )
  endif()

  if(NOT OSMESA_INCLUDE_DIR)
    find_path(OSMESA_INCLUDE_DIR GL/osmesa.h PATHS
      /usr/openwin/share/include
      /opt/graphics/OpenGL/include
    )
  endif()
endif()

# This may be left blank if OSMesa symbols are included
# in the main Mesa library
if(NOT OSMESA_LIBRARY)
  # If we have a root defined look there first
  if(OSMESA_ROOT)
    find_library(OSMESA_LIBRARY OSMesa PATHS ${OSMESA_ROOT}/lib
      NO_DEFAULT_PATH
    )
  endif()

  if(NOT OSMESA_LIBRARY)
    find_library(OSMESA_LIBRARY OSMesa PATHS
      /opt/graphics/OpenGL/lib
      /usr/openwin/lib
    )
  endif()
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OSMesa  DEFAULT_MSG  OSMESA_LIBRARY  OSMESA_INCLUDE_DIR)

mark_as_advanced(OSMESA_INCLUDE_DIR OSMESA_LIBRARY)

Allow location of OSMesa install to be specified

Allow the location of an OSMesa install to be specified and
search there first for includes and library. The location
can be specified by setting OSMESA_ROOT.

Change-Id: I0afe52b9f81a70a990d36d6895a3ce50720706a9


set(CAMKES_APP "system" CACHE STRING "The one and only CAmkES application in this project")
#set(CAPDL_LOADER_APP "capdl-loader-app" CACHE STRING "")
set(CAPDL_LOADER_APP "kata-os-rootserver" CACHE STRING "")

set(PLATFORM "sparrow" CACHE STRING "The one and only seL4 platform for Sparrow")
set(RUST_TARGET "riscv32imac-unknown-none-elf" CACHE STRING "Rust target_arch")
set(KernelSel4Arch "riscv32" CACHE STRING "Specifies 32-bit branch of the seL4 spike platform")
set(KernelIsMCS ON CACHE BOOL "Enable seL4 MCS support")
set(KernelPrinting ON CACHE BOOL "Enable seL4 console output support")

set(LibUtilsDefaultZfLogLevel 5 CACHE STRING "seL4 internal logging level (0-5).")
set(SIMULATION ON CACHE BOOL "Whether to build simulate script")
set(RELEASE OFF CACHE BOOL "Performance optimized build")
set(UseRiscVBBL OFF CACHE BOOL "Whether to use bbl")

set(CAMKES_APP "system" CACHE STRING "The one and only CAmkES application in this project")
#set(CAPDL_LOADER_APP "capdl-loader-app" CACHE STRING "")
set(CAPDL_LOADER_APP "kata-os-rootserver" CACHE STRING "")

set(PLATFORM "sparrow" CACHE STRING "The one and only seL4 platform for Sparrow")
set(RUST_TARGET "riscv32imac-unknown-none-elf" CACHE STRING "Rust target_arch")
set(KernelSel4Arch "riscv32" CACHE STRING "Specifies 32-bit branch of the seL4 spike platform")
set(KernelIsMCS ON CACHE BOOL "Enable seL4 MCS support")
set(KernelPrinting ON CACHE BOOL "Enable seL4 console output support")
set(CAmkESDefaultHeapSize "8192" CACHE STRING "CAmkES per-component heap size (bytes)")

set(LibUtilsDefaultZfLogLevel 5 CACHE STRING "seL4 internal logging level (0-5).")
set(SIMULATION ON CACHE BOOL "Whether to build simulate script")
set(RELEASE OFF CACHE BOOL "Performance optimized build")
set(UseRiscVBBL OFF CACHE BOOL "Whether to use bbl")

Reduce CAmkES per-component heap allocation.

Set the per-component static heap size to 8KB. The heap is only used by
CAmkES RPC for marhsaling dynamic array & string parameters. We mostly
use the former and no more than 4KB at a time so 8KB should be fine until
we can redirect C use to the Rust heap allocator (or replace the C code).

BUG=224069025

Change-Id: I600854c5cb41ed268087f4b2294b70c3384973c2
GitOrigin-RevId: 177a353e6873f2c048cf4b446114534d9dcffc94


include(bde_interface_target)
include(bde_package)
include(bde_struct)

bde_prefixed_override(bdls process_package)
function(bdls_process_package retPackage)
    process_package_base("" package ${ARGN})

    bde_struct_get_field(interfaceTarget ${package} INTERFACE_TARGET)
    bde_interface_target_link_libraries(
        ${interfaceTarget}
        PUBLIC
            $<$<CXX_COMPILER_ID:SunPro>:socket>
    )

    bde_return(${package})
endfunction()

include(bde_interface_target)
include(bde_package)
include(bde_struct)

bde_prefixed_override(bdls process_package)
function(bdls_process_package retPackage)
    process_package_base("" package ${ARGN})

    if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
        bde_struct_get_field(interfaceTarget ${package} INTERFACE_TARGET)
        bde_interface_target_link_libraries(
            ${interfaceTarget}
            PUBLIC
                socket
        )
    endif()

    bde_return(${package})
endfunction()

Fix gcc link error on Solaris.

Fix gcc link error on Solaris.


#Contact: Pierre Lassalle <lassallepierre34@gmail.com>
otb_fetch_module(otbGRM
  "This module provides the GRM OTB application to perform multiscale
region-merging segmentation on satellite images. Three local homogeneity
criteria are available: the Baatz & Schäpe criterion, the Full Lambda Schedule
criterion and the simple Euclidean Distance criterion.  This application uses
the GRM (Generic Region Merging) library which allows quickly adding a new local
homogeneity criterion. Look at the template header file: GRMSegmenterTemplate.h
to see which format you must respect to add a new criterion.

A more detailed description can be found on the project website:
http://tully.ups-tlse.fr/lassallep/grm
"
  GIT_REPOSITORY https://github.com/orfeotoolbox/GRM
  GIT_TAG 209161cc0b3fadad7999e80b83838868f430289e
)

#Contact: Pierre Lassalle <lassallepierre34@gmail.com>
otb_fetch_module(otbGRM
  "This module provides the GRM OTB application to perform multiscale
region-merging segmentation on satellite images. Three local homogeneity
criteria are available: the Baatz & Schäpe criterion, the Full Lambda Schedule
criterion and the simple Euclidean Distance criterion.  This application uses
the GRM (Generic Region Merging) library which allows quickly adding a new local
homogeneity criterion. Look at the template header file: GRMSegmenterTemplate.h
to see which format you must respect to add a new criterion.

A more detailed description can be found on the project website:
http://tully.ups-tlse.fr/lassallep/grm
"
  GIT_REPOSITORY https://github.com/orfeotoolbox/GRM
  GIT_TAG c53a61d12b895a85c3909130021988730c309cb7
)

Revert "update git tag for GRM"

Revert "update git tag for GRM"

This reverts commit 168d71d2e317d47f4634b45a2b058977779d1c48.


prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Tcam
Description: Camera control and image acquisition library
Version: @TCAM_VERSION@
Requires: @tcam_pkgconfig_dependencies@
Libs: -L${libdir} -ltcam
Cflags: -I${includedir}/

prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Tcam
Description: Camera control and image acquisition library
Version: @TCAM_VERSION@
Requires: @tcam_pkgconfig_dependencies@
Libs: -L${libdir} -ltcam -ltcamprop
Cflags: -I${includedir}/

Add tcamprop to Libs list

Add tcamprop to Libs list


function(adopt_subprojects)

    # Add subprojects for CMSIS
    set(NAME "CMSIS")
    if (";${SUBPROJECTS};" MATCHES ";${NAME};")
        list(REMOVE_ITEM SUBPROJECTS ${NAME})
        list(APPEND SUBPROJECTS
                CMSIS/BasicMathFunctions
                CMSIS/CommonTables
                CMSIS/ComplexMathFunctions
                CMSIS/ControllerFunctions
                CMSIS/FastMathFunctions
                CMSIS/FilteringFunctions
                CMSIS/MatrixFunctions
                CMSIS/StatisticsFunctions
                CMSIS/SupportFunctions
                CMSIS/TransformFunctions)
        set(SUBPROJECTS ${SUBPROJECTS} PARENT_SCOPE)
        set(CMSIS_BASE_DIR ${CSiBE_SRC_DIR}/CMSIS PARENT_SCOPE)
    endif()

endfunction(adopt_subprojects)

function(adopt_subprojects)

    # Add subprojects for CMSIS
    set(CMSIS_NAME "CMSIS")
    if (";${SUBPROJECTS};" MATCHES ";${CMSIS_NAME};")
        list(REMOVE_ITEM SUBPROJECTS ${CMSIS_NAME})
        list(APPEND SUBPROJECTS
                CMSIS/BasicMathFunctions
                CMSIS/CommonTables
                CMSIS/ComplexMathFunctions
                CMSIS/ControllerFunctions
                CMSIS/FastMathFunctions
                CMSIS/FilteringFunctions
                CMSIS/MatrixFunctions
                CMSIS/StatisticsFunctions
                CMSIS/SupportFunctions
                CMSIS/TransformFunctions)
        set(SUBPROJECTS ${SUBPROJECTS} PARENT_SCOPE)
        set(CMSIS_BASE_DIR ${CSiBE_SRC_DIR}/CMSIS PARENT_SCOPE)
    endif()

endfunction(adopt_subprojects)

Rename generic NAME variable to the more specific CMSIS_NAME


# This CMake file is responsible for functionality tied to running vagrant and ansible
# from CTest.
set(ANSIBLE_INVENTORY "${PROJECT_SOURCE_DIR}/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory" CACHE FILEPATH "")
set(ANSIBLE_PRIVATE_KEY "${PROJECT_SOURCE_DIR}/.vagrant/machines/girder/virtualbox/private_key" CACHE FILEPATH "")
set(ANSIBLE_USER "vagrant" CACHE STRING "User to ssh into the vagrantbox as")

function(add_ansible_test case)
  set(name "ansible_client_test_${case}")
  set(VAGRANT_ENV_VARS "ANSIBLE_CLIENT_TESTING=1"
                       "ANSIBLE_TESTING=1")

  add_test(
    NAME ${name}
    WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
    COMMAND "${ANSIBLE_PLAYBOOK_EXECUTABLE}" -i ${ANSIBLE_INVENTORY} --private-key=${ANSIBLE_PRIVATE_KEY} -u ${ANSIBLE_USER} "${PROJECT_SOURCE_DIR}/devops/ansible/roles/girder/library/test/test_${case}.yml" -v
    )

  set_tests_properties("${name}" PROPERTIES
    DEPENDS vagrant_up
    RUN_SERIAL ON
    ENVIRONMENT "${VAGRANT_ENV_VARS}"
    # This happens in the case where vagrant up fails, failing to generate a valid host file.
    # Without this, ansible would return a valid exit status since it provisioned 0 hosts correctly.
    FAIL_REGULAR_EXPRESSION "Host file not found"
    LABELS girder_ansible_client)
  set_property(GLOBAL APPEND PROPERTY vagrant_tests "${name}")
endfunction()

# This CMake file is responsible for functionality tied to running vagrant and ansible
# from CTest.
set(ANSIBLE_INVENTORY "${PROJECT_SOURCE_DIR}/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory" CACHE FILEPATH "")
set(ANSIBLE_PRIVATE_KEY "${PROJECT_SOURCE_DIR}/.vagrant/machines/girder/virtualbox/private_key" CACHE FILEPATH "")
set(ANSIBLE_USER "vagrant" CACHE STRING "User to ssh into the vagrantbox as")

function(add_ansible_test case)
  set(name "ansible_client_test_${case}")
  set(VAGRANT_ENV_VARS "ANSIBLE_CLIENT_TESTING=1"
                       "ANSIBLE_TESTING=1")

  add_test(
    NAME ${name}
    WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
    COMMAND "${ANSIBLE_PLAYBOOK_EXECUTABLE}" -i ${ANSIBLE_INVENTORY} --private-key=${ANSIBLE_PRIVATE_KEY} -u ${ANSIBLE_USER} "${PROJECT_SOURCE_DIR}/devops/ansible/roles/girder/library/test/test_${case}.yml" -v
    )

  set_tests_properties("${name}" PROPERTIES
    DEPENDS vagrant_up
    RUN_SERIAL ON
    ENVIRONMENT "${VAGRANT_ENV_VARS}"
    # This happens in the case where vagrant up fails, failing to generate a valid host file.
    # Without this, ansible would return a valid exit status since it provisioned 0 hosts correctly.
    FAIL_REGULAR_EXPRESSION "Host file not found;no hosts matched"
    LABELS girder_ansible_client)
  set_property(GLOBAL APPEND PROPERTY vagrant_tests "${name}")
endfunction()

Fix failure regex to include when plays are run on 0 hosts because of mismatching hosts


if (ADOLC_INCLUDES AND ADOLC_LIBRARIES)
  set(ADOLC_FIND_QUIETLY TRUE)
endif (ADOLC_INCLUDES AND ADOLC_LIBRARIES)

find_path(ADOLC_INCLUDES
  NAMES
  adolc/adouble.h
  PATHS
  $ENV{ADOLCDIR}
  ${INCLUDE_INSTALL_DIR}
)

find_library(ADOLC_LIBRARIES adolc PATHS $ENV{ADOLCDIR} ${LIB_INSTALL_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ADOLC DEFAULT_MSG
                                  ADOLC_INCLUDES ADOLC_LIBRARIES)

mark_as_advanced(ADOLC_INCLUDES ADOLC_LIBRARIES)

if (ADOLC_INCLUDES AND ADOLC_LIBRARIES)
  set(ADOLC_FIND_QUIETLY TRUE)
endif (ADOLC_INCLUDES AND ADOLC_LIBRARIES)

find_path(ADOLC_INCLUDES
  NAMES
  adolc/adtl.h
  PATHS
  $ENV{ADOLCDIR}
  ${INCLUDE_INSTALL_DIR}
)

find_library(ADOLC_LIBRARIES adolc PATHS $ENV{ADOLCDIR} ${LIB_INSTALL_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ADOLC DEFAULT_MSG
                                  ADOLC_INCLUDES ADOLC_LIBRARIES)

mark_as_advanced(ADOLC_INCLUDES ADOLC_LIBRARIES)

Make sure ADOLC is recent enough by searching for adtl.h


set(LABEL_EXPR "$ENV{label_exp}")
if ("${LABEL_EXPR}" MATCHES "gcc")
  message(STATUS "Set CXX to g++ based on label_expr content")
  set(CMAKE_C_COMPILER "gcc" CACHE PATH "c++ compiler option")
  set(CMAKE_CXX_COMPILER "g++" CACHE PATH "c++ compiler option")
elseif ("${LABEL_EXPR}" MATCHES "clang")
  message(STATUS "Set CXX to clang++ based on label_expr content")
  set(CMAKE_C_COMPILER "clang" CACHE STRING "c++ compiler option")
  set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "c++ compiler option")
endif()
if ("${LABEL_EXPR}" MATCHES "asio")
  message(STATUS "Set define to use boost asio for the multiplexer")
  add_definitions(-DCAF_USE_ASIO)
endif()

set(LABEL_EXPR "$ENV{label_exp}")
if ("${LABEL_EXPR}" MATCHES "gcc")
  message(STATUS "Set CXX to g++ based on label_expr content")
  set(CMAKE_C_COMPILER "gcc" CACHE PATH "c++ compiler option")
  set(CMAKE_CXX_COMPILER "g++" CACHE PATH "c++ compiler option")
elseif ("${LABEL_EXPR}" MATCHES "clang")
  message(STATUS "Set CXX to clang++ based on label_expr content")
  set(CMAKE_C_COMPILER "clang" CACHE STRING "c++ compiler option")
  set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "c++ compiler option")
endif()
if ("${LABEL_EXPR}" MATCHES "asio")
  message(STATUS "Set define to use boost asio for the multiplexer")
  set(CAF_USE_ASIO yes)
endif()

Fix ASIO setup for Jenkins

Fix ASIO setup for Jenkins


list(APPEND CMAKE_MODULE_PATH
	"${CMAKE_SOURCE_DIR}"
	"${CMAKE_SOURCE_DIR}/cmake/Modules"
)

if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Intel")
	set(CMAKE_COMPILER_IS_GNUCC TRUE)
endif()
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
	set(CMAKE_COMPILER_IS_GNUCXX TRUE)
endif()

if(CMAKE_COMPILER_IS_GNUCC)
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
endif()

# This file is included only if sampgdk is built as a root project (i.e. not
# as a subdirectory).

list(APPEND CMAKE_MODULE_PATH
  "${CMAKE_SOURCE_DIR}"
  "${CMAKE_SOURCE_DIR}/cmake/Modules"
)

if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
   "${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
  set(CMAKE_COMPILER_IS_GNUCC TRUE)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
   "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
  set(CMAKE_COMPILER_IS_GNUCXX TRUE)
endif()

if(CMAKE_COMPILERIS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
  set(flags "-m32 -Wno-attributes")
  if(CMAKE_COMPILER_IS_GNUCC)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flags}")
  endif()
  if(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flags}")
  endif()
endif()

Add missing quotes around variable

Add missing quotes around variable


get_filename_component(INSTALLED_PREFIX ${Newbase_DIR} DIRECTORY)
get_filename_component(INSTALLED_PREFIX ${INSTALLED_PREFIX} DIRECTORY)
get_filename_component(INSTALLED_PREFIX ${INSTALLED_PREFIX} DIRECTORY)
set(Newbase_INCLUDE_DIRS ${INSTALLED_PREFIX}/include)
set(Newbase_INSTALLED_INCLUDE_DIRS ${INSTALLED_PREFIX}/include/newbase)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
    option(Newbase_USE_STATIC_LIBS "Newbase use static libs" OFF)

    if(Newbase_USE_STATIC_LIBS)
        set(Newbase_LIBRARIES  ${INSTALLED_PREFIX}/lib/libNewbase.a)
    else()
        set(Newbase_LIBRARIES  ${INSTALLED_PREFIX}/lib/libNewbase.so)
    endif()

    if(NOT EXISTS ${Newbase_LIBRARIES})
        message(STATUS "Library ${Newbase_LIBRARIES} not found.")
    endif()
    set(Newbase_INSTALLED_LIBRARIES ${Newbase_LIBRARIES})
else()
    set(Newbase_INSTALLED_LIBRARIES ${INSTALLED_PREFIX}/lib/NewBase.lib)
    set(Newbase_LIBRARIES  ${INSTALLED_PREFIX}/lib/Newbase.lib)
endif()

get_filename_component(INSTALLED_PREFIX ${Newbase_DIR} DIRECTORY)
get_filename_component(INSTALLED_PREFIX ${INSTALLED_PREFIX} DIRECTORY)
get_filename_component(INSTALLED_PREFIX ${INSTALLED_PREFIX} DIRECTORY)
set(Newbase_INCLUDE_DIRS ${INSTALLED_PREFIX}/include)
set(Newbase_INSTALLED_INCLUDE_DIRS ${INSTALLED_PREFIX}/include/newbase)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
    # If static and shared library is available, one can select
    # which one to use. By default use shared one.
    if(NOT ${PROJECT_NAME} MATCHES "Newbase")
        option(Newbase_USE_STATIC_LIBS "Newbase use static libs" OFF)
    endif()

    if(Newbase_USE_STATIC_LIBS)
        set(Newbase_LIBRARIES  ${INSTALLED_PREFIX}/lib/libNewbase.a)
    else()
        set(Newbase_LIBRARIES  ${INSTALLED_PREFIX}/lib/libNewbase.so)
    endif()

    if(NOT EXISTS ${Newbase_LIBRARIES})
        message(STATUS "Library ${Newbase_LIBRARIES} not found.")
    endif()
    set(Newbase_INSTALLED_LIBRARIES ${Newbase_LIBRARIES})
else()
    set(Newbase_INSTALLED_LIBRARIES ${INSTALLED_PREFIX}/lib/NewBase.lib)
    set(Newbase_LIBRARIES  ${INSTALLED_PREFIX}/lib/Newbase.lib)
endif()

Add Newbase_USE_STATIC_LIBS option only for other projects


# Macro support for python easy_install modules.

if (NOT easy_install)

if (NOT FLYEM_BUILD_DIR)
    message (FATAL_ERROR "ERROR: FlyEM build directory (for all downloads & builds) should be specified via -DFLYEM_BUILD_DIR=<path> on cmake command line.")
endif ()

macro (easy_install PKG_NAME)

    include (python)
    include (setuptools)

    if (NOT python-${PKG_NAME})

        set (python-${PKG_NAME} TRUE)
        add_custom_target (${PKG_NAME}
            DEPENDS ${APP_DEPENDENCIES}
            COMMAND ${FLYEM_ENV_STRING}  easy_install ${PKG_NAME}
            COMMENT "Installing ${PKG_NAME} via easy_install")

        # Append this package to our list of dependencies
        if (NOT APP_DEPENDENCIES)
            set (APP_DEPENDENCIES ${PKG_NAME})
        else ()
            set (APP_DEPENDENCIES ${APP_DEPENDENCIES} ${PKG_NAME})
        endif ()

    endif ()

endmacro (easy_install)

endif (NOT easy_install)

# Macro support for python easy_install modules.

if (NOT easy_install)

if (NOT FLYEM_BUILD_DIR)
    message (FATAL_ERROR "ERROR: FlyEM build directory (for all downloads & builds) should be specified via -DFLYEM_BUILD_DIR=<path> on cmake command line.")
endif ()

macro (easy_install PKG_NAME)

    include (python)
    include (setuptools)

    if (NOT python-${PKG_NAME})

        set (python-${PKG_NAME} TRUE)
        add_custom_target (${PKG_NAME}
            DEPENDS ${python_NAME} ${setuptools_NAME}
            COMMAND ${FLYEM_ENV_STRING}  easy_install ${PKG_NAME}
            COMMENT "Installing ${PKG_NAME} via easy_install")

        # Append this package to our list of dependencies
        if (NOT APP_DEPENDENCIES)
            set (APP_DEPENDENCIES ${PKG_NAME})
        else ()
            set (APP_DEPENDENCIES ${APP_DEPENDENCIES} ${PKG_NAME})
        endif ()

    endif ()

endmacro (easy_install)

endif (NOT easy_install)

Fix dependency for easy_install module

Fix dependency for easy_install module


# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "1087403e3407a40a3342d27b3169b9a8e042b2ad")

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

# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "5e256e60d6c3552f9ce24a1df364abd3a11045ef")

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

Update FW with OpenVino FW fix

Update FW with OpenVino FW fix


# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "f9df8e9f3115e796682ff3499068b04f782f888f")

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

# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "808326d10e913968d18316f6fb9c6d18175231ae")

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

Update device FW: fix X,Y,Z calc on NN bounding box


#-----------------------------------------------------------------------------
# MITK Data
#-----------------------------------------------------------------------------

# Sanity checks
if(DEFINED MITK_DATA_DIR AND NOT EXISTS ${MITK_DATA_DIR})
  message(FATAL_ERROR "MITK_DATA_DIR variable is defined but corresponds to non-existing directory")
endif()

set(proj MITK-Data)
set(proj_DEPENDENCIES)
set(MITK-Data_DEPENDS ${proj})

if(BUILD_TESTING)

  set(revision_tag da5dd4ff) # first 8 characters of hash-tag
#                  ^^^^^^^^  these are just to check correct length of hash part

  ExternalProject_Add(${proj}
    SOURCE_DIR ${proj}
    GIT_REPOSITORY https://phabricator.mitk.org/source/mitkdata.git
    GIT_TAG ${revision_tag}
#   URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/mitk-data_${revision_tag}.tar.gz
#   UPDATE_COMMAND ""
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ""
    DEPENDS ${proj_DEPENDENCIES}
  )

  set(MITK_DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj})

else()

  mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")

endif(BUILD_TESTING)

#-----------------------------------------------------------------------------
# MITK Data
#-----------------------------------------------------------------------------

# Sanity checks
if(DEFINED MITK_DATA_DIR AND NOT EXISTS ${MITK_DATA_DIR})
  message(FATAL_ERROR "MITK_DATA_DIR variable is defined but corresponds to non-existing directory")
endif()

set(proj MITK-Data)
set(proj_DEPENDENCIES)
set(MITK-Data_DEPENDS ${proj})

if(BUILD_TESTING)

# set(revision_tag da5dd4ff) # first 8 characters of hash-tag
#                  ^^^^^^^^  these are just to check correct length of hash part

  ExternalProject_Add(${proj}
    SOURCE_DIR ${proj}
    GIT_REPOSITORY https://phabricator.mitk.org/source/mitkdata.git
#   GIT_TAG ${revision_tag}
#   URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/mitk-data_${revision_tag}.tar.gz
#   UPDATE_COMMAND ""
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ""
    DEPENDS ${proj_DEPENDENCIES}
  )

  set(MITK_DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj})

else()

  mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")

endif(BUILD_TESTING)

Clone head of master branch

Clone head of master branch


#/// @file   FindTbagOpenCV.cmake
#/// @brief  Find the OpenCV library.
#/// @author zer0
#/// @date   2016-05-31
#///
#/// @remarks
#///  The following variables are optionally searched for defaults:
#///    - ${OpenCV_ROOT}

if (NOT DEFINED OpenCV_ROOT)
    if (IS_DIRECTORY "${THIRD_PREFIX}")
        set (OpenCV_ROOT "${THIRD_PREFIX}")
    else ()
        set (OpenCV_ROOT "/usr/local")
    endif ()
endif ()

set (__tbag_opencv_module_dir "${OpenCV_ROOT}/share/OpenCV")
if (NOT IS_DIRECTORY "${__tbag_opencv_module_dir}")
    if (IS_DIRECTORY "/usr/local/share/OpenCV")
        set (__tbag_opencv_module_dir "/usr/local/share/OpenCV")
    else ()
        message (WARNING "Not found OpenCV Modules directory: ${__tbag_opencv_module_dir}")
    endif ()
endif ()

if (NOT OpenCV_FOUND)
    list (FIND "${CMAKE_MODULE_PATH}" "${__tbag_opencv_module_dir}" __opencv_module_index)
    if (__opencv_module_index EQUAL -1)
        list (APPEND CMAKE_MODULE_PATH "${__tbag_opencv_module_dir}")
    endif ()
    find_package (OpenCV REQUIRED)
endif ()

if (OpenCV_FOUND)
    message (STATUS "Found OpenCV: ${OpenCV_LIBS}")
endif ()

#/// @file   FindTbagOpenCV.cmake
#/// @brief  Find the OpenCV library.
#/// @author zer0
#/// @date   2016-05-31
#///
#/// @remarks
#///  The following variables are optionally searched for defaults:
#///    - ${OpenCV_ROOT}

if (NOT DEFINED OpenCV_ROOT)
    if (IS_DIRECTORY "${THIRD_PREFIX}")
        set (OpenCV_ROOT "${THIRD_PREFIX}")
    else ()
        set (OpenCV_ROOT "/usr/local")
    endif ()
endif ()

set (__tbag_opencv_module_dir "${OpenCV_ROOT}/share/OpenCV")
if (NOT IS_DIRECTORY "${__tbag_opencv_module_dir}")
    if (IS_DIRECTORY "/usr/local/share/OpenCV")
        set (__tbag_opencv_module_dir "/usr/local/share/OpenCV")
    else ()
        #message (WARNING "Not found OpenCV Modules directory: ${__tbag_opencv_module_dir}")
    endif ()
endif ()

if (NOT OpenCV_FOUND)
    list (FIND "${CMAKE_MODULE_PATH}" "${__tbag_opencv_module_dir}" __opencv_module_index)
    if (__opencv_module_index EQUAL -1)
        list (APPEND CMAKE_MODULE_PATH "${__tbag_opencv_module_dir}")
    endif ()
    find_package (OpenCV REQUIRED)
endif ()

if (OpenCV_FOUND)
    message (STATUS "Found OpenCV: ${OpenCV_LIBS}")
endif ()

Remove OpenCV module related message.

Remove OpenCV module related message.


# the top-level README is used for describing this module, just
# re-used it for documentation here
get_filename_component( MY_CURENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file( READ "${MY_CURENT_DIR}/README" DOCUMENTATION )

# itk_module() defines the module dependencies in ITKStreamingSinc
# ITKStreamingSinc depends on ITKCommon
# The testing module in ITKStreamingSinc depends on ITKTestKernel
# and ITKMetaIO(besides ITKStreamingSinc and ITKCore)

# ITK version 4.5 changed it from EXCLUDE_FROM_ALL to EXCLUDE_FROM_DEFAULT
set( _EXCLUDE "EXCLUDE_FROM_ALL" )
if (NOT "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_MINOR_PATCH}" VERSION_LESS "4.5")
  set( _EXCLUDE "EXCLUDE_FROM_DEFAULT" )
endif()

# define the dependencies of the include module and the tests
itk_module(StreamingSinc
  DEPENDS
    ITKCommon
    ITKImageFilterBase
    ITKStatistics
    ITKImageStatistics
  TEST_DEPENDS
    ITKTestKernel
    ITKStatistics
  DESCRIPTION
    "${DOCUMENTATION}"
  ${_EXCLUDE}
)

# the top-level README is used for describing this module, just
# re-used it for documentation here
get_filename_component( MY_CURENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file( READ "${MY_CURENT_DIR}/README" DOCUMENTATION )

# ITK version 4.5 changed it from EXCLUDE_FROM_ALL to EXCLUDE_FROM_DEFAULT
set( _EXCLUDE "EXCLUDE_FROM_ALL" )
if (NOT "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_MINOR_PATCH}" VERSION_LESS "4.5")
  set( _EXCLUDE "EXCLUDE_FROM_DEFAULT" )
endif()

# itk_module() defines the module dependencies in ITKStreamingSinc
# ITKStreamingSinc depends on ITKCommon
# The testing module in ITKStreamingSinc depends on ITKTestKernel
# and ITKMetaIO(besides ITKStreamingSinc and ITKCore)

# ITK version 4.5 changed it from EXCLUDE_FROM_ALL to EXCLUDE_FROM_DEFAULT
set( _EXCLUDE "EXCLUDE_FROM_ALL" )
if (NOT "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_MINOR_PATCH}" VERSION_LESS "4.5")
  set( _EXCLUDE "EXCLUDE_FROM_DEFAULT" )
endif()

# define the dependencies of the include module and the tests
itk_module(StreamingSinc
  DEPENDS
    ITKCommon
    ITKImageFilterBase
    ITKStatistics
    ITKImageStatistics
    ITKImageGrid
  TEST_DEPENDS
    ITKTestKernel
    ITKStatistics
    ITKSmoothing
  DESCRIPTION
    "${DOCUMENTATION}"
  ${_EXCLUDE}
)

Update exclude from all and module dependencies


function(find_meta_examples)
	FILE(GLOB_RECURSE META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/*.sg)

	# temporary hacks to exclude certain meta examples that have dependencies
	IF(NOT HAVE_NLOPT)
		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/gaussian_processes/gaussian_process_regression.sg)
	ENDIF()

	IF(NOT USE_GPL_SHOGUN)
		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS
			${CMAKE_SOURCE_DIR}/examples/meta/src/gaussian_processes/gaussian_process_regression.sg
			${CMAKE_SOURCE_DIR}/examples/meta/src/multiclass_classifier/multiclass_logisticregression.sg
			)
	ENDIF()

	IF(NOT HAVE_LAPACK)
		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/regression/linear_ridge_regression.sg)
	ENDIF()

	IF(NOT USE_SVMLIGHT)
		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/regression/multiple_kernel_learning.sg)
	ENDIF()

	SET(META_EXAMPLES ${META_EXAMPLE_LISTINGS} PARENT_SCOPE)
endfunction()

function(find_meta_examples)
	FILE(GLOB_RECURSE META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/*.sg)

	# temporary hacks to exclude certain meta examples that have dependencies
	IF(NOT HAVE_NLOPT)
		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/gaussian_processes/gaussian_process_regression.sg)
	ENDIF()

	IF(NOT USE_GPL_SHOGUN)
		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS
			${CMAKE_SOURCE_DIR}/examples/meta/src/gaussian_processes/gaussian_process_regression.sg
			${CMAKE_SOURCE_DIR}/examples/meta/src/multiclass_classifier/multiclass_logisticregression.sg
			)
	ENDIF()

	IF(NOT HAVE_LAPACK)
		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS
			${CMAKE_SOURCE_DIR}/examples/meta/src/regression/linear_ridge_regression.sg
			${CMAKE_SOURCE_DIR}/examples/meta/src/clustering/gmm.sg
			)
	ENDIF()

	IF(NOT USE_SVMLIGHT)
		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/regression/multiple_kernel_learning.sg)
	ENDIF()

	SET(META_EXAMPLES ${META_EXAMPLE_LISTINGS} PARENT_SCOPE)
endfunction()

Remove GMM meta example if LAPACK is not available


## Find the libtbag library.
#
# The following variables are optionally searched for defaults
#  Tbag_ROOT
#
# The following are set after configuration is done:
#  Tbag_FOUND
#  Tbag_INCLUDE_DIRS
#  Tbag_LIBRARIES

if (Tbag_FOUND)
    return ()
endif ()

set (__headers "libtbag/config.h")
set (__libs    "tbag")

if (IS_DIRECTORY "$ENV{TBAG_HOME}")
    set (Tbag_ROOT_INCLUDE_PATHS "$ENV{TBAG_HOME}")
    set (Tbag_ROOT_LIBRARY_PATHS "$ENV{TBAG_HOME}/build")
endif ()

include (TbagSimpleFindLibrary)
tbag_simple_find_library_with_module_prefix ("${__headers}" "${__libs}")

## Find the libtbag library.
#
# The following variables are optionally searched for defaults
#  Tbag_ROOT
#
# The following are set after configuration is done:
#  Tbag_FOUND
#  Tbag_INCLUDE_DIRS
#  Tbag_LIBRARIES

if (Tbag_FOUND)
    return ()
endif ()

set (__headers "libtbag/config.h")
set (__libs    "tbag")

if (IS_DIRECTORY "$ENV{TBAG_HOME}")
    set (Tbag_ROOT_INCLUDE_PATHS "$ENV{TBAG_HOME}")
    set (Tbag_ROOT_LIBRARY_PATHS "$ENV{TBAG_HOME}/build"
                                 "$ENV{TBAG_HOME}/cmake-build-debug"
                                 "$ENV{TBAG_HOME}/cmake-build-release")
endif ()

include (TbagSimpleFindLibrary)
tbag_simple_find_library_with_module_prefix ("${__headers}" "${__libs}")

Update libtbag cmake library path.

Update libtbag cmake library path.


# client maintainer: simon.rit@creatis.insa-lyon.fr
set(CTEST_SITE "shiitake.clb")
set(CTEST_BUILD_NAME "Linux-64bit-intel")
set(CTEST_BUILD_CONFIGURATION Release)
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(dashboard_binary_name "RTK_lin64_intel")
set(ENV{ITK_DIR} "/home/srit/src/itk/lin64")

# Set intel compiler
set(ENV{CC}  /opt/intel/bin/icc)   # C compiler
set(ENV{CXX} /opt/intel/bin/icpc)  # C++ compiler

include("${CTEST_SCRIPT_DIRECTORY}/rtk_common.cmake")

# client maintainer: simon.rit@creatis.insa-lyon.fr
set(CTEST_SITE "shiitake.clb")
set(CTEST_BUILD_NAME "Linux-64bit-intel")
set(CTEST_BUILD_CONFIGURATION Release)
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(dashboard_binary_name "RTK_lin64_intel")
set(ENV{ITK_DIR} "/home/srit/src/itk/lin64-intel")

# Set intel compiler
set(ENV{CC}  /opt/intel/bin/icc)   # C compiler
set(ENV{CXX} /opt/intel/bin/icpc)  # C++ compiler

include("${CTEST_SCRIPT_DIRECTORY}/rtk_common.cmake")

Use ITK compiled with Intel

Use ITK compiled with Intel


# This is an example cmake that defines two important variables:
# - G4Application_INCLUDE_DIR: what you have specify as include path
# - G4Application_LIBRARY: what you have to libraries for the target
#
# It requires you to set the G4APPLICATION_DIR to point to the
#   g4Application root directory.
if (NOT G4APPLICATION_DIR )
    message(send_error "Please set G4APPLICATION_DIR variable.")
else()
    message(STATUS "Using g4Application from ${G4APPLICATION_DIR}.")
    find_path(G4Application_INCLUDE_DIR "Plugin.hh" HINTS "${G4APPLICATION_DIR}/include")
    find_library(G4Application_LIBRARY g4Application HINTS ${G4APPLICATION_DIR})
endif()

# This is an example cmake that defines two important variables:
# - G4Application_INCLUDE_DIR: what you have specify as include path
# - G4Application_LIBRARY: what you have to libraries for the target
#
# It requires you to set the G4APPLICATION_DIR to point to the
#   g4Application root directory.
if (NOT DEFINED ENV{G4APPLICATION_DIR} )
    message(ERROR "Please set G4APPLICATION_DIR variable.")
else()
    message(STATUS "Using g4Application from ${G4APPLICATION_DIR}.")
    find_path(G4Application_INCLUDE_DIR "Plugin.hh" HINTS "$ENV{G4APPLICATION_DIR}/include")
    find_library(G4Application_LIBRARY g4Application HINTS $ENV{G4APPLICATION_DIR})
endif()

Use env.variable G4APPLICATION_DIR in cmake


vtk_module(vtkRenderingGL2PS
  TCL_NAME vtkRenderingGLtoPS
  DEPENDS
    vtkRenderingContext${VTK_RENDERING_BACKEND}
  PRIVATE_DEPENDS
    vtkRendering${VTK_RENDERING_BACKEND}
    vtkRenderingFreeType
    vtkgl2ps
  TEST_DEPENDS
    vtkTestingRendering
    vtkInteractionStyle
  KIT
    vtkOpenGL
)

vtk_module(vtkRenderingGL2PS
  TCL_NAME vtkRenderingGLtoPS
  BACKEND
    OpenGL
  DEPENDS
    vtkRenderingContext${VTK_RENDERING_BACKEND}
  PRIVATE_DEPENDS
    vtkRendering${VTK_RENDERING_BACKEND}
    vtkRenderingFreeType
    vtkgl2ps
  TEST_DEPENDS
    vtkTestingRendering
    vtkInteractionStyle
  KIT
    vtkOpenGL
)

Mark gl2ps as being part of the OpenGL backend

gl2ps is only compatible with the old opengl implementation
so marking it as part of that backend as it cannot compile
without it.


# Prepare everything for using FindQt5 and building a Qt5 target.
macro(setup_qt)
    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
        # Search for 64bit Qt
        set(QT_ROOT $ENV{QT_ROOT_64})
    else()
        # Search for 32bit Qt
        set(QT_ROOT $ENV{QT_ROOT_32})
    endif()

    list(APPEND CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake/Qt5)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER moc)
    source_group(moc REGULAR_EXPRESSION .*/moc_.+\\.cpp)
endmacro()

# Prepare everything for using FindQt5 and building a Qt5 target.
macro(setup_qt)
    if(NOT QT_ROOT)
        if(CMAKE_SIZEOF_VOID_P EQUAL 8)
            # Search for 64bit Qt
            set(QT_ROOT $ENV{QT_ROOT_64})
        else()
            # Search for 32bit Qt
            set(QT_ROOT $ENV{QT_ROOT_32})
        endif()
    endif()

    list(APPEND CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake/Qt5)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER moc)
    source_group(moc REGULAR_EXPRESSION .*/moc_.+\\.cpp)
endmacro()

Allow the Qt directory to be set from the command line.


find_library(GLFW_LIBRARY glfw3)
find_path(GLFW_INCLUDE_DIR glfw3.h PATH_SUFFIXES GLFW)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLFW GLFW_LIBRARY GLFW_INCLUDE_DIR)

find_library(GLFW_LIBRARY NAMES glfw3 glfw)
find_path(GLFW_INCLUDE_DIR glfw3.h PATH_SUFFIXES GLFW)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLFW GLFW_LIBRARY GLFW_INCLUDE_DIR)

Fix GLFW library search by cmake

Fix GLFW library search by cmake

On mac, the glfw library is called libglfw3.dylib. On Linux (or at least on my
system) it's called libglfw.so. That's why we now specify both of these names
in the cmake find module.


## Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.

#get the root folder of this sdk
get_filename_component(_ROOT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
include("${_ROOT_DIR}/boostutils.cmake")

boost_flib("thread")
set(_deps)
if(UNIX)
  list(APPEND _deps PTHREAD)
endif()
list(APPEND _deps BOOST_CHRONO)
qi_set_global(BOOST_THREAD_DEPENDS ${_deps})

## Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.

#get the root folder of this sdk
get_filename_component(_ROOT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
include("${_ROOT_DIR}/boostutils.cmake")

boost_flib("thread")
set(_deps)
if(UNIX)
  list(APPEND _deps PTHREAD)
endif()
#boost threads depends on chrono starting from version 1.50
if (Boost_VERSION GREATER "104900")
  list(APPEND _deps BOOST_CHRONO)
endif()
qi_set_global(BOOST_THREAD_DEPENDS ${_deps})

Remove dependency to boost_chrono for boost version less than 1.49

Change-Id: I181b9c30e669bf1aa4fbada063b7400b9893a0ef
Reviewed-on: http://gerrit.aldebaran.lan:8080/10101
Reviewed-by: cgestes <ddb78fe00abb42f91254c16a0860e38eb0781789@aldebaran-robotics.com>
Tested-by: proullon <ffff9135679d397f48dd743107119b1f6fc32d3d@aldebaran-robotics.com>


#---Custom CTest settings---------------------------------------------------

set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE} test-stressgui test-stressproof)

if(WIN32)
  set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE} test-tcollex)
endif()

if(CTEST_BUILD_NAME MATCHES icc)  #  sse tests of vc fail for icc compiler
  set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE}
      vc-math_sse
      vc-math_VC_LOG_ILP2_sse
      vc-math_VC_LOG_ILP_sse
      stressVdt)
endif()

#---Custom CTest settings---------------------------------------------------

set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE} test-stressgui test-stressproof)

if(WIN32)
  set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE} test-tcollex)
endif()

if(CTEST_BUILD_NAME MATCHES icc)  #  sse tests of vc fail for icc compiler
  set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE}
      vc-math_sse
      vc-math_VC_LOG_ILP2_sse
      vc-math_VC_LOG_ILP_sse
      stressVdt)
elseif(CTEST_BUILD_NAME MATCHES clang7)
  set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE}
      vc-swizzles_avx)
endif()

Disable test vc-swizzles_avx for Xcode 7.


find_path(_udt_INCLUDE_DIR udt.h
  HINTS ${UDT_ROOT}/include
  PATHS /usr/include /usr/local/include /opt/local/include /usr/include/udt)

find_library(_udt_LIBRARY NAMES udt
  HINTS ${UDT_ROOT}/lib
  PATHS /usr/lib /usr/local/lib /opt/local/lib)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UDT DEFAULT_MSG
  _udt_INCLUDE_DIR _udt_LIBRARY)

set(UDT_INCLUDE_DIRS ${_udt_INCLUDE_DIR})
set(UDT_LIBRARIES ${_udt_LIBRARY})
if(_udt_INCLUDE_DIR)
  file(STRINGS "${_udt_INCLUDE_DIR}/udt.h" UDT_HAS_RCVDATA REGEX UDT_RCVDATA)
endif()

if(UDT_FOUND)
  message(STATUS "Found UDT in ${UDT_INCLUDE_DIRS};${UDT_LIBRARIES}")
endif()

find_path(_udt_INCLUDE_DIR udt.h
  HINTS ${UDT_ROOT}/include
  PATHS /usr/include /usr/local/include /opt/local/include /usr/include/udt)

find_library(_udt_LIBRARY NAMES udt
  HINTS ${UDT_ROOT}/lib
  PATHS /usr/lib /usr/local/lib /opt/local/lib)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UDT DEFAULT_MSG
  _udt_INCLUDE_DIR _udt_LIBRARY)

set(UDT_INCLUDE_DIRS ${_udt_INCLUDE_DIR})
set(UDT_LIBRARIES ${_udt_LIBRARY})
if(_udt_INCLUDE_DIR)
  file(STRINGS "${_udt_INCLUDE_DIR}/udt.h" UDT_HAS_RCVDATA REGEX UDT_RCVDATA)
endif()

if(UDT_FOUND AND NOT UDT_FIND_QUIETLY)
  message(STATUS "Found UDT in ${UDT_INCLUDE_DIRS};${UDT_LIBRARIES}")
endif()

Implement QUIET for UDT finder

Implement QUIET for UDT finder


include(ExternalProject)

ExternalProject_Add(libcvd
	SOURCE_DIR ${MRPT_SOURCE_DIR}/otherlibs/libcvd
	CMAKE_ARGS
		-DCMAKE_POSITION_INDEPENDENT_CODE=ON
		-DCVD_SSE2=${CMAKE_MRPT_HAS_SSE2}
		-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
		-DCVD_TESTS=OFF
		-DCVD_PROGS=OFF
		-DCVD_EXAMPLES=OFF
	INSTALL_COMMAND ""
)

set(CVD_DIR "${MRPT_SOURCE_DIR}/otherlibs/libcvd")
set(CVD_BIN_DIR "${MRPT_BINARY_DIR}/libcvd-prefix/src/libcvd-build")

set(CVD_INCLUDE_DIRS "${CVD_DIR}" "${CVD_BIN_DIR}/include")

if(MSVC)
	set(CVD_LIB "${CVD_BIN_DIR}/$<CONFIG>/CVD$<$<CONFIG:Debug>:_debug>.lib")
else()
	set(CVD_LIB "${CVD_BIN_DIR}/libCVD$<$<CONFIG:Debug>:_debug>.a")
endif()

include(ExternalProject)

ExternalProject_Add(libcvd
	SOURCE_DIR ${MRPT_SOURCE_DIR}/otherlibs/libcvd
	CMAKE_ARGS
		-DCMAKE_POSITION_INDEPENDENT_CODE=ON
		# No SSE2: Gives problems in non Intel archs, and anyway we don't exploit libcvd CPU-intensive ops from mrpt
		-DCVD_SSE2=OFF
		-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
		-DCVD_TESTS=OFF
		-DCVD_PROGS=OFF
		-DCVD_EXAMPLES=OFF
	INSTALL_COMMAND ""
)

set(CVD_DIR "${MRPT_SOURCE_DIR}/otherlibs/libcvd")
set(CVD_BIN_DIR "${MRPT_BINARY_DIR}/libcvd-prefix/src/libcvd-build")

set(CVD_INCLUDE_DIRS "${CVD_DIR}" "${CVD_BIN_DIR}/include")

if(MSVC)
	set(CVD_LIB "${CVD_BIN_DIR}/$<CONFIG>/CVD$<$<CONFIG:Debug>:_debug>.lib")
else()
	set(CVD_LIB "${CVD_BIN_DIR}/libCVD$<$<CONFIG:Debug>:_debug>.a")
endif()

Fix mrpt build in non-Intel archs (disable SSE2 in libcvd)


#
# ONLY MODIFY TO CHANGE VERSION
#
# The number of commits since last this file has changed is used to
# define "dev" and "post", modification of this file will reset that
# version.
#

# Version info

set(SimpleITK_VERSION_MAJOR 1)
set(SimpleITK_VERSION_MINOR 2)
set(SimpleITK_VERSION_PATCH 3)
#set(SimpleITK_VERSION_TWEAK "")

include(sitkSourceVersion)

# pre-release codes are defined based on suffix of most recent tags.

# a[N]+<b[N]+<c[N]+=rc[N]+
if(NOT ${_GIT_VERSION_RC} STREQUAL "" )
  set(SimpleITK_VERSION_RC "${_GIT_VERSION_RC}")
endif()

# The hash is the current git sha1 hash tag of the HEAD.
set(SimpleITK_VERSION_HASH "${_GIT_VERSION_HASH}")

# DEV or POST is set to the number of commits since this file has been
# changed. If the MAJOR.MINOR.[PATCH[.TWEAK]] matches "closest"
# version tag then its consider in the release branch and POST is set
# while DEV is undefined, otherwise we are considered under
# development and DEV is set and POST is undefined.
if(DEFINED _GIT_VERSION_POST)
  set(SimpleITK_VERSION_POST "${_GIT_VERSION_POST}")
elseif(DEFINED _GIT_VERSION_DEV)
  set(SimpleITK_VERSION_DEV "${_GIT_VERSION_DEV}")
endif()

#
# ONLY MODIFY TO CHANGE VERSION
#
# The number of commits since last this file has changed is used to
# define "dev" and "post", modification of this file will reset that
# version.
#

# Version info

set(SimpleITK_VERSION_MAJOR 1)
set(SimpleITK_VERSION_MINOR 2)
set(SimpleITK_VERSION_PATCH 4)
#set(SimpleITK_VERSION_TWEAK "")

include(sitkSourceVersion)

# pre-release codes are defined based on suffix of most recent tags.

# a[N]+<b[N]+<c[N]+=rc[N]+
if(NOT ${_GIT_VERSION_RC} STREQUAL "" )
  set(SimpleITK_VERSION_RC "${_GIT_VERSION_RC}")
endif()

# The hash is the current git sha1 hash tag of the HEAD.
set(SimpleITK_VERSION_HASH "${_GIT_VERSION_HASH}")

# DEV or POST is set to the number of commits since this file has been
# changed. If the MAJOR.MINOR.[PATCH[.TWEAK]] matches "closest"
# version tag then its consider in the release branch and POST is set
# while DEV is undefined, otherwise we are considered under
# development and DEV is set and POST is undefined.
if(DEFINED _GIT_VERSION_POST)
  set(SimpleITK_VERSION_POST "${_GIT_VERSION_POST}")
elseif(DEFINED _GIT_VERSION_DEV)
  set(SimpleITK_VERSION_DEV "${_GIT_VERSION_DEV}")
endif()

Increment minor version to 1.2.4

Increment minor version to 1.2.4


find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
find_program(CTEST_GIT_COMMAND NAMES git)

set(CTEST_SITE "bigeye")
if(WIN32)
  set(CTEST_DASHBOARD_ROOT "C:/tmp/us")
else()
  set(CTEST_DASHBOARD_ROOT "/tmp/us")
  set(CTEST_BUILD_FLAGS "-j")
  #set(CTEST_COMPILER "gcc-4.5")
endif()

set(CTEST_CONFIGURATION_TYPE Debug)
set(CTEST_PARALLEL_LEVEL 4)

set(US_TEST_SHARED 1)
set(US_TEST_STATIC 1)

set(US_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../")

set(US_BUILD_CONFIGURATION )
foreach(i RANGE 7)
  list(APPEND US_BUILD_CONFIGURATION ${i})
endforeach()

if(WIN32 AND NOT MINGW)
  set(US_CMAKE_GENERATOR
      "Visual Studio 9 2008"
      "Visual Studio 10"
      "Visual Studio 11"
     )
endif()

include(${US_SOURCE_DIR}/cmake/usCTestScript.cmake)

find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
find_program(CTEST_GIT_COMMAND NAMES git)

set(CTEST_SITE "bigeye")
if(WIN32)
  set(CTEST_DASHBOARD_ROOT "C:/tmp/us")
else()
  set(CTEST_DASHBOARD_ROOT "/tmp/us")
  set(CTEST_BUILD_FLAGS "-j")
  #set(CTEST_COMPILER "gcc-4.5")
endif()

set(CTEST_CONFIGURATION_TYPE Release)
set(CTEST_BUILD_CONFIGURATION Release)

set(CTEST_PARALLEL_LEVEL 4)

set(US_TEST_SHARED 1)
set(US_TEST_STATIC 1)

set(US_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../")

set(US_BUILD_CONFIGURATION )
foreach(i RANGE 7)
  list(APPEND US_BUILD_CONFIGURATION ${i})
endforeach()

if(WIN32 AND NOT MINGW)
  set(US_CMAKE_GENERATOR
      "Visual Studio 9 2008"
      "Visual Studio 10"
      "Visual Studio 11"
     )
endif()

include(${US_SOURCE_DIR}/cmake/usCTestScript.cmake)

Use Release configuration for ctest scripting.


# Packaging configuration
SET(CPACK_PACKAGE_NAME "allpix-squared")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Generic Pixel Detector Simulation Framework")
SET(CPACK_PACKAGE_VENDOR "The Allpix Squared Authors")
SET(CPACK_PACKAGE_CONTACT "The Allpix Squared Authors <allpix.squared@cern.ch>")
SET(CPACK_PACKAGE_ICON "doc/logo_small.png")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.md")

# Set version dervied from project version:
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
IF("${PROJECT_VERSION_PATCH}" STREQUAL "")
    SET(CPACK_PACKAGE_VERSION_PATCH "0")
ELSE()
    SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
ENDIF()

SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-latest_$ENV{BUILD_FLAVOUR}")

# Configure the targets and components to include
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_COMPONENTS_ALL application modules)
SET(CPACK_INSTALLED_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/setup/;.")

# Packaging configuration
SET(CPACK_PACKAGE_NAME "allpix-squared")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Generic Pixel Detector Simulation Framework")
SET(CPACK_PACKAGE_VENDOR "The Allpix Squared Authors")
SET(CPACK_PACKAGE_CONTACT "The Allpix Squared Authors <allpix.squared@cern.ch>")
SET(CPACK_PACKAGE_ICON "doc/logo_small.png")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.md")

# Figure out, which system we are running on:
IF(DEFINED ENV{BUILD_FLAVOUR})
    SET(CPACK_SYSTEM_NAME $ENV{BUILD_FLAVOUR})
ELSE()
    SET(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
ENDIF()

# Set version dervied from project version, or "latest" for untagged:
IF(NOT TAG_FOUND)
    SET(CPACK_PACKAGE_VERSION "latest")
ELSE()
    SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
ENDIF()

SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")

# Configure the targets and components to include
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_COMPONENTS_ALL application modules)
SET(CPACK_INSTALLED_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/setup/;.")

Rework output filename of tarballs

Rework output filename of tarballs


# -*- cmake -*-
include(Prebuilt)

if (NOT STANDALONE)
  use_prebuilt_binary(libhunspell)
  use_prebuilt_binary(nd_hacdConvexDecomposition)
  use_prebuilt_binary(libuuid)
  use_prebuilt_binary(slvoice)
  use_prebuilt_binary(fontconfig)
endif(NOT STANDALONE)

if(VIEWER AND NOT STANDALONE)
  if(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
    message(STATUS "We seem to have an artwork bundle in the tree - brilliant.")
  else(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
    message(FATAL_ERROR "Didn't find an artwork bundle - this needs to be downloaded separately and unpacked into this tree.  You can probably get it from the same place you got your viewer source.  Thanks!")
  endif(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
endif(VIEWER AND NOT STANDALONE)

# -*- cmake -*-
include(Prebuilt)

if (NOT STANDALONE)
  use_prebuilt_binary(libhunspell)
  use_prebuilt_binary(nd_hacdConvexDecomposition)
  use_prebuilt_binary(libuuid)
  use_prebuilt_binary(slvoice)
  use_prebuilt_binary(fontconfig)
  use_prebuilt_binary(quicktime)
endif(NOT STANDALONE)

if(VIEWER AND NOT STANDALONE)
  if(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
    message(STATUS "We seem to have an artwork bundle in the tree - brilliant.")
  else(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
    message(FATAL_ERROR "Didn't find an artwork bundle - this needs to be downloaded separately and unpacked into this tree.  You can probably get it from the same place you got your viewer source.  Thanks!")
  endif(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
endif(VIEWER AND NOT STANDALONE)

Add Quicktime prebuilt to the list of used libs; Quicktime never got downloaded and the plugin never got build properly if no QT SDK was installed


add_external_project_or_use_system(python
  CONFIGURE_COMMAND <SOURCE_DIR>/configure
                    --prefix=<INSTALL_DIR>
                    --enable-unicode=ucs4
                    --enable-shared
  PROCESS_ENVIRONMENT CFLAGS -I${CMAKE_OSX_SYSROOT}/usr/include
  )
set (pv_python_executable "${install_location}/bin/python3" CACHE INTERNAL "" FORCE)

add_extra_cmake_args(
  -DPYTHON_EXECUTABLE:FILEPATH=<INSTALL_DIR>/bin/python3
  -DPYTHON_INCLUDE_DIR:PATH=<INSTALL_DIR>/include/python3.6m
  -DPYTHON_LIBRARY:FILEPATH=<INSTALL_DIR>/lib/libpython3.6m.dylib
  -DVTK_PYTHON_VERSION:STRING=3)

Add extra cmake args for Python

Add extra cmake args for Python


# Defines the following variables
#
# - GBENCHMARK_FOUND if the library is found
# - GBENCHMARK_LIBRARY is the path to the library
# - GBENCHMARK_INCLUDE_DIR is the path to the include directory
if(GBENCHMARK_FOUND)
  return()
endif()

find_library(GBENCHMARK_LIBRARY benchmark DOC "Path to the google benchmark library")
find_path(
  GBENCHMARK_INCLUDE_DIR benchmark/benchmark.h
  DOC "Path to google benchmark include directory"
  PATHS "${casapath}"
)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
  GBENCHMARK
  REQUIRED_VARS GBENCHMARK_LIBRARY GBENCHMARK_INCLUDE_DIR
)
if(GBENCHMARK_FOUND)
  if(GBENCHMARK_LIBRARY MATCHES "\\.a$")
    add_library(gbenchmark STATIC IMPORTED GLOBAL)
  else()
    add_library(gbenchmark SHARED IMPORTED GLOBAL)
  endif()
  set_target_properties(gbenchmark PROPERTIES
    IMPORTED_LOCATION "${GBENCHMARK_LIBRARY}"
    INTERFACE_INCLUDE_DIRECTORIES "${GBENCHMARK_INCLUDE_DIR}")
endif()

# Defines the following variables
#
# - GBENCHMARK_FOUND if the library is found
# - GBENCHMARK_LIBRARY is the path to the library
# - GBENCHMARK_INCLUDE_DIR is the path to the include directory
if(NOT GBENCHMARK_FOUND)
  find_library(GBENCHMARK_LIBRARY benchmark DOC "Path to the google benchmark library")
  find_path(
      GBENCHMARK_INCLUDE_DIR benchmark/benchmark.h
      DOC "Path to google benchmark include directory"
      PATHS "${casapath}"
  )

  include(FindPackageHandleStandardArgs)
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(
      GBENCHMARK
      REQUIRED_VARS GBENCHMARK_LIBRARY GBENCHMARK_INCLUDE_DIR
  )
endif()

if(GBENCHMARK_FOUND)
  if(GBENCHMARK_LIBRARY MATCHES "\\.a$")
    add_library(gbenchmark STATIC IMPORTED GLOBAL)
  else()
    add_library(gbenchmark SHARED IMPORTED GLOBAL)
  endif()
  set_target_properties(gbenchmark PROPERTIES
      IMPORTED_LOCATION "${GBENCHMARK_LIBRARY}"
      INTERFACE_INCLUDE_DIRECTORIES "${GBENCHMARK_INCLUDE_DIR}"
  )
endif()

Make sure gbenchmark always defined

Make sure gbenchmark always defined


if (DOWNLOAD_EXTERNALS)

  # Configure hiredis
  # -----------------
  ExternalProject_Add(hiredis
    GIT_REPOSITORY "https://github.com/redis/hiredis.git"
    DOWNLOAD_DIR ${EXTERNALS_DIR}/hiredis
    SOURCE_DIR ${EXTERNALS_DIR}/hiredis/hiredis
    BINARY_DIR ${EXTERNALS_DIR}/hiredis/hiredis
    STAMP_DIR ${EXTERNALS_DIR}/hiredis/stamp
    TMP_DIR ${EXTERNALS_DIR}/hiredis/tmp
    UPDATE_COMMAND "" # don't update, i.e., always use the same version
    CONFIGURE_COMMAND "" # skip configure
    BUILD_COMMAND make
    INSTALL_COMMAND "" # skip install
  )

else ()

  set(HIREDIS_INCLUDE_DIRS ${EXTERNALS_DIR}/hiredis/hiredis)
  set(HIREDIS_LIB_DIRS "${EXTERNALS_DIR}/hiredis/hiredis")
  set(HIREDIS_LIBS libhiredis.a)

endif ()

if (DOWNLOAD_EXTERNALS)

  # Configure hiredis
  # -----------------
  ExternalProject_Add(hiredis
    GIT_REPOSITORY "https://github.com/redis/hiredis.git"
    DOWNLOAD_DIR ${EXTERNALS_DIR}/hiredis
    SOURCE_DIR ${EXTERNALS_DIR}/hiredis/hiredis
    BINARY_DIR ${EXTERNALS_DIR}/hiredis/hiredis
    STAMP_DIR ${EXTERNALS_DIR}/hiredis/stamp
    TMP_DIR ${EXTERNALS_DIR}/hiredis/tmp
    UPDATE_COMMAND "" # don't update, i.e., always use the same version
    CONFIGURE_COMMAND "" # skip configure
    BUILD_COMMAND make static
    INSTALL_COMMAND "" # skip install
  )

else ()

  set(HIREDIS_INCLUDE_DIRS ${EXTERNALS_DIR}/hiredis/hiredis)
  set(HIREDIS_LIB_DIRS "${EXTERNALS_DIR}/hiredis/hiredis")
  set(HIREDIS_LIBS libhiredis.a)

endif ()

Build only the hiredis static library.

Build only the hiredis static library.


itk_fetch_module(LesionSizingToolkit
  "Framework for determining the sizes of lesions in medical images."
  GIT_REPOSITORY ${git_protocol}://public.kitware.com/LesionSizingToolkit.git
  GIT_TAG fd9cfcef3bb4f7678bc50ecbe6ad51c6998cc3db
  )

itk_fetch_module(LesionSizingToolkit
  "Framework for determining the sizes of lesions in medical images."
  GIT_REPOSITORY http://public.kitware.com/LesionSizingToolkit.git
  GIT_TAG 100ec226866cca13a6ed0f5c2d3520f45750424d
  )

COMP: Update LesionSizingToolkit for external build and style test failures.

The protocol also needs to be http because https is not yet supported.

Change-Id: Idff3ddc72c55920ade7847f1978f0c90b5ce5945


# target_use_itk
#
# This function has the following form:
#   sitk_target_use_itk(<target>
#                       <PRIVATE|PUBLIC|INTERFACE>
#                       [itk_module [itk_module [...]]])
#
#   It configures the target, with the require include directories and
# link libraries to use the list of itk modules provided. The keyword
# to indicate interface of the library is also required.

function(sitk_target_use_itk target_name interface_keyword)

  set(itk_modules ${ARGV})
  list(REMOVE_AT itk_modules 0 1)

  itk_module_config(_itk ${itk_modules})

  if(_itk_LIBRARIES)
    target_link_libraries( ${target_name}
      ${interface_keyword}
      ${_itk_LIBRARIES} )
  endif()
  if(_itk_INCLUDE_DIRS)
    target_include_directories( ${target_name}
      ${interface_keyword}
      ${_itk_INCLUDE_DIRS} )
  endif()

endfunction()

# target_use_itk
#
# This function has the following form:
#   sitk_target_use_itk(<target>
#                       <PRIVATE|PUBLIC|INTERFACE>
#                       [itk_module [itk_module [...]]])
#
#   It configures the target, with the require include directories and
# link libraries to use the list of itk modules provided. The keyword
# to indicate interface of the library is also required.

function(sitk_target_use_itk target_name interface_keyword)

  set(itk_modules ${ARGV})
  list(REMOVE_AT itk_modules 0 1)

  itk_module_config(_itk ${itk_modules})

  if(_itk_LIBRARY_DIRS)
    link_libraries(${_itk_LIBRARY_DIRS})
  endif()

  if(_itk_LIBRARIES)
    target_link_libraries( ${target_name}
      ${interface_keyword}
      ${_itk_LIBRARIES} )
  endif()
  if(_itk_INCLUDE_DIRS)
    target_include_directories( ${target_name}
      ${interface_keyword}
      ${_itk_INCLUDE_DIRS} )
  endif()

endfunction()

Add library directories if needed when using an ITK module


# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "73f5dfe7a318e713481dd00d134c2c597112afff")

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

# Maturity level "snapshot" / "release"
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "bfb509700962dc4d8d78de9be30a49efa98e25f8")

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

Update FW with error reporting for DetectionNetwork


include(ExternalProject)

FIND_PACKAGE(Boost)
if(Boost-NOTFOUND)
  include(BoostMinimal)
endif()

if(ENABLE_TESTS)
	include(GTest-1.6)
endif()

include(Redis)

include(JavaScriptCore)
include(JSObjects)

include(SwigJS)
include(RedisDocStore)
add_dependencies(store_external swig_js)

Declare a project dependency to force correct build order of externals.


#-----------------------------------------------------------------------------
# MITK Data
#-----------------------------------------------------------------------------

# Sanity checks
IF(DEFINED MITK_DATA_DIR AND NOT EXISTS ${MITK_DATA_DIR})
  MESSAGE(FATAL_ERROR "MITK_DATA_DIR variable is defined but corresponds to non-existing directory")
ENDIF()

IF(BUILD_TESTING)
  SET(proj MITK-Data)
  ExternalProject_Add(${proj}
    GIT_REPOSITORY ssh://git@mbits/MITK-Data
    GIT_TAG "origin/master"
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ""
  )
  SET(MITK_DATA_DIR ${ep_source_dir}/${proj})
ENDIF(BUILD_TESTING)

#-----------------------------------------------------------------------------
# MITK Data
#-----------------------------------------------------------------------------

# Sanity checks
IF(DEFINED MITK_DATA_DIR AND NOT EXISTS ${MITK_DATA_DIR})
  MESSAGE(FATAL_ERROR "MITK_DATA_DIR variable is defined but corresponds to non-existing directory")
ENDIF()

IF(BUILD_TESTING)
  SET(proj MITK-Data)
  ExternalProject_Add(${proj}
    GIT_REPOSITORY http://mbits/git/MITK-Data.git
    GIT_TAG "origin/master"
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ""
  )
  SET(MITK_DATA_DIR ${ep_source_dir}/${proj})
ENDIF(BUILD_TESTING)

Use anonymous http clone for MITK testing data


# - Locate hdfs (from hadoop) library
# Defines:
#
#  HDFS_FOUND
#  HDFS_INCLUDE_DIR
#  HDFS_INCLUDE_DIRS (not cached)
#  HDFS_LIBRARIES

find_path(HDFS_INCLUDE_DIR NAMES hdfs.h  HINTS ${HDFS_DIR}/include $ENV{HDFS_DIR}/include /usr/include/hadoop)
find_library(HDFS_LIBRARY NAMES hdfs HINTS ${HDFS_DIR}/lib/native $ENV{HDFS_DIR}/lib/native)

set(HDFS_INCLUDE_DIRS ${HDFS_INCLUDE_DIR})
set(HDFS_LIBRARIES ${HDFS_LIBRARY})

# handle the QUIETLY and REQUIRED arguments and set HDFS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDFS DEFAULT_MSG HDFS_INCLUDE_DIR HDFS_LIBRARY)

mark_as_advanced(HDFS_FOUND HDFS_INCLUDE_DIR HDFS_LIBRARY)

# - Locate hdfs (from hadoop) library
# Defines:
#
#  HDFS_FOUND
#  HDFS_INCLUDE_DIR
#  HDFS_INCLUDE_DIRS (not cached)
#  HDFS_LIBRARIES

find_path(HDFS_INCLUDE_DIR NAMES hdfs.h  HINTS ${HDFS_DIR}/include $ENV{HDFS_DIR}/include /usr/include/hadoop)
find_library(HDFS_LIBRARY NAMES hdfs PATH_SUFFIXES native HINTS ${HDFS_DIR}/lib $ENV{HDFS_DIR}/lib)

set(HDFS_INCLUDE_DIRS ${HDFS_INCLUDE_DIR})
set(HDFS_LIBRARIES ${HDFS_LIBRARY})

# handle the QUIETLY and REQUIRED arguments and set HDFS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDFS DEFAULT_MSG HDFS_INCLUDE_DIR HDFS_LIBRARY)

mark_as_advanced(HDFS_FOUND HDFS_INCLUDE_DIR HDFS_LIBRARY)

Fix for ROOT-7650 - Complete the 'hdfs' option with CMake


# define system dependent compiler flags

include(CheckCXXCompilerFlag)

if (UNIX AND NOT WIN32)
  # with -fPIC
  if (CMAKE_SIZEOF_VOID_P MATCHES "8")
    check_cxx_compiler_flag("-fPIC" WITH_FPIC)
    if (WITH_FPIC)
      add_definitions(-fPIC)
    endif (WITH_FPIC)

    # with large file support
    execute_process(
      COMMAND
        getconf LFS64_CFLAGS
      OUTPUT_VARIABLE
        _lfs_CFLAGS
      ERROR_QUIET
      OUTPUT_STRIP_TRAILING_WHITESPACE
  )
  else (CMAKE_SIZEOF_VOID_P MATCHES "8")
    # with large file support
    execute_process(
      COMMAND
        getconf LFS_CFLAGS
      OUTPUT_VARIABLE
        _lfs_CFLAGS
      ERROR_QUIET
      OUTPUT_STRIP_TRAILING_WHITESPACE
    )
  endif (CMAKE_SIZEOF_VOID_P MATCHES "8")

  string(REGEX REPLACE "[\r\n]" " " ${_lfs_CFLAGS} "${${_lfs_CFLAGS}}")

  add_definitions(${_lfs_CFLAGS})

  add_definitions(-Wall -W -Wmissing-prototypes -Wdeclaration-after-statement -D_FORTIFY_SOURCE=2)
endif (UNIX AND NOT WIN32)

# define system dependent compiler flags

include(CheckCXXCompilerFlag)

if (UNIX AND NOT WIN32)
  # with -fPIC
  if (CMAKE_SIZEOF_VOID_P MATCHES "8")
    check_cxx_compiler_flag("-fPIC" WITH_FPIC)
    if (WITH_FPIC)
      add_definitions(-fPIC)
    endif (WITH_FPIC)

    # with large file support
    execute_process(
      COMMAND
        getconf LFS64_CFLAGS
      OUTPUT_VARIABLE
        _lfs_CFLAGS
      ERROR_QUIET
      OUTPUT_STRIP_TRAILING_WHITESPACE
  )
  else (CMAKE_SIZEOF_VOID_P MATCHES "8")
    # with large file support
    execute_process(
      COMMAND
        getconf LFS_CFLAGS
      OUTPUT_VARIABLE
        _lfs_CFLAGS
      ERROR_QUIET
      OUTPUT_STRIP_TRAILING_WHITESPACE
    )
  endif (CMAKE_SIZEOF_VOID_P MATCHES "8")

  string(REGEX REPLACE "[\r\n]" " " ${_lfs_CFLAGS} "${${_lfs_CFLAGS}}")

  add_definitions(${_lfs_CFLAGS})
  add_definitions(-Wall -W -Wmissing-prototypes -Wdeclaration-after-statement)

  check_cxx_compiler_flag("-fstack-protector" WITH_STACK_PROTECTOR)
  if (WITH_STACK_PROTECTOR)
    add_definitions(-fstack-protector)
  endif (WITH_STACK_PROTECTOR)

  check_cxx_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
  if (WITH_FORTIFY_SOURCE)
    add_definitions(-D_FORTIFY_SOURCE=2)
  endif (WITH_FORTIFY_SOURCE)

endif (UNIX AND NOT WIN32)

Add stackprotector flag and check for fourtify source.


function(mitkFunctionEnablePlugins)
  if(MITK_WHITELIST STREQUAL "None")
    return()
  endif()

  string(FIND "${MITK_WHITELIST}" " (external)" index REVERSE)

  if(${index} EQUAL -1)
    set(whitelistFile "${MITK_WHITELISTS_PATH}/${MITK_WHITELIST}.cmake")
  else()
    string(SUBSTRING "${MITK_WHITELIST}" 0 ${index} whitelistFile)
    set(whitelistFile "${MITK_EXTERNAL_WHITELISTS_PATH}/${whitelistFile}.cmake")
  endif()

  include(${whitelistFile})

  if(NOT DEFINED enabled_plugins)
    message(FATAL_ERROR "Variable 'enabled_plugins' not set in whitelist file '${whitelistFile}'!")
  endif()

  set(plugins)

  foreach(plugin ${${ARGV0}})
    string(FIND ${plugin} ":" index REVERSE)

    if (NOT index EQUAL -1)
      string(SUBSTRING ${plugin} 0 ${index} _plugin)
    else()
      set(_plugin ${plugin})
    endif()

    list(FIND enabled_plugins ${_plugin} index)

    if(NOT index EQUAL -1)
      list(APPEND plugins ${plugin})
    endif()
  endforeach()

  set(${ARGV0} ${plugins} PARENT_SCOPE)
endfunction()

function(mitkFunctionEnablePlugins)
  if(MITK_WHITELIST STREQUAL "None")
    return()
  endif()

  string(FIND "${MITK_WHITELIST}" " (external)" index REVERSE)

  if(${index} EQUAL -1)
    set(whitelistFile "${MITK_WHITELISTS_PATH}/${MITK_WHITELIST}.cmake")
  else()
    string(SUBSTRING "${MITK_WHITELIST}" 0 ${index} whitelistFile)
    set(whitelistFile "${MITK_EXTERNAL_WHITELISTS_PATH}/${whitelistFile}.cmake")
  endif()

  include(${whitelistFile})

  if(NOT DEFINED enabled_plugins)
    message(FATAL_ERROR "Variable 'enabled_plugins' not set in whitelist file '${whitelistFile}'!")
  endif()

  set(plugins "")

  foreach(plugin ${${ARGV0}})
    string(FIND ${plugin} ":" index REVERSE)

    if (NOT index EQUAL -1)
      string(SUBSTRING ${plugin} 0 ${index} _plugin)
    else()
      set(_plugin ${plugin})
    endif()

    list(FIND enabled_plugins ${_plugin} index)

    if(NOT index EQUAL -1)
      list(APPEND plugins ${plugin})
    endif()
  endforeach()

  set(${ARGV0} ${plugins} PARENT_SCOPE)
endfunction()

Set default plugins variable to empty string.