## ---------------------------------------------------------------------
##
## Copyright (C) 2017 by the deal.II authors
##
## This file is part of the deal.II library.
##
## The deal.II library is free software; you can use it, redistribute
## it, and/or modify it under the terms of the GNU Lesser General
## Public License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
## The full text of the license can be found in the file LICENSE at
## the top level of the deal.II distribution.
##
## ---------------------------------------------------------------------

#
# Try to find the ASSIMP libraries
#
# This module exports
#
#   ASSIMP_LIBRARIES
#   ASSIMP_INCLUDE_DIRS
#

SET(ASSIMP_DIR "" CACHE PATH "An optional hint to a Assimp installation")
SET_IF_EMPTY(ASSIMP_DIR "$ENV{ASSIMP_DIR}")

DEAL_II_FIND_LIBRARY(ASSIMP_LIB NAMES assimp
  HINTS ${ASSIMP_DIR}
  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
  )

DEAL_II_FIND_PATH(ASSIMP_INC assimp/defs.h
  HINTS ${ASSIMP_DIR}
  )

DEAL_II_PACKAGE_HANDLE(ASSIMP
  LIBRARIES REQUIRED ASSIMP_LIB
  INCLUDE_DIRS REQUIRED ASSIMP_INC
  USER_INCLUDE_DIRS REQUIRED ASSIMP_INC
  CLEAR ASSIMP_LIB ASSIMP_INC
  )

## ---------------------------------------------------------------------
##
## Copyright (C) 2017 by the deal.II authors
##
## This file is part of the deal.II library.
##
## The deal.II library is free software; you can use it, redistribute
## it, and/or modify it under the terms of the GNU Lesser General
## Public License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
## The full text of the license can be found in the file LICENSE at
## the top level of the deal.II distribution.
##
## ---------------------------------------------------------------------

#
# Try to find the ASSIMP libraries
#
# This module exports
#
#   ASSIMP_LIBRARIES
#   ASSIMP_INCLUDE_DIRS
#

SET(ASSIMP_DIR "" CACHE PATH "An optional hint to a Assimp installation")
SET_IF_EMPTY(ASSIMP_DIR "$ENV{ASSIMP_DIR}")

DEAL_II_FIND_LIBRARY(ASSIMP_LIB NAMES assimp
  HINTS ${ASSIMP_DIR}
  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
  )

DEAL_II_FIND_PATH(ASSIMP_INC assimp/defs.h
  HINTS ${ASSIMP_DIR}
  PATH_SUFFIXES include
  )

DEAL_II_PACKAGE_HANDLE(ASSIMP
  LIBRARIES REQUIRED ASSIMP_LIB
  INCLUDE_DIRS REQUIRED ASSIMP_INC
  USER_INCLUDE_DIRS REQUIRED ASSIMP_INC
  CLEAR ASSIMP_LIB ASSIMP_INC
  )

Add an extra hint for assimp.

Add an extra hint for assimp.

If assimp has its own directory, e.g., ASSIMP_DIR=/opt/assimp/, then
this hint is needed.


# Copyright (c) 2016, Ruslan Baratov, Alexandre Pretyman
# All rights reserved.

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_configuration_types)
include(hunter_pick_scheme)
include(hunter_download)

hunter_add_version(
    PACKAGE_NAME
    PostgreSQL
    VERSION
    "9.5.0"
    URL
    "https://github.com/hunter-packages/PostgreSQL/archive/PostgreSQL-9.5.0.tar.gz"
    SHA1
    b82ddcee4644ef42f3a69ee93916afa448d178c4
)

hunter_configuration_types(PostgreSQL CONFIGURATION_TYPES Release)
hunter_pick_scheme(DEFAULT url_sha1_autotools)
hunter_cacheable(PostgreSQL)
hunter_download(PACKAGE_NAME PostgreSQL
    PACKAGE_UNRELOCATABLE_TEXT_FILES
    "lib/pkgconfig/libecpg.pc"
    "lib/pkgconfig/libecpg_compat.pc"
    "lib/pkgconfig/libpgtypes.pc"
    "lib/pkgconfig/libpq.pc"
    "lib/postgresql/pgxs/src/Makefile.global"
)

# Copyright (c) 2016, Ruslan Baratov, Alexandre Pretyman
# All rights reserved.

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_configuration_types)
include(hunter_pick_scheme)
include(hunter_download)

hunter_add_version(
    PACKAGE_NAME
    PostgreSQL
    VERSION
    "9.5.0"
    URL
    "https://github.com/hunter-packages/PostgreSQL/archive/PostgreSQL-9.5.0.tar.gz"
    SHA1
    b82ddcee4644ef42f3a69ee93916afa448d178c4
)

if (ANDROID OR IOS)
  hunter_cmake_args(
      PostgreSQL
      CMAKE_ARGS
          EXTRA_FLAGS=--without-readline
  )
endif()

hunter_configuration_types(PostgreSQL CONFIGURATION_TYPES Release)
hunter_pick_scheme(DEFAULT url_sha1_autotools)
hunter_cacheable(PostgreSQL)
hunter_download(PACKAGE_NAME PostgreSQL
    PACKAGE_UNRELOCATABLE_TEXT_FILES
    "lib/pkgconfig/libecpg.pc"
    "lib/pkgconfig/libecpg_compat.pc"
    "lib/pkgconfig/libpgtypes.pc"
    "lib/pkgconfig/libpq.pc"
    "lib/postgresql/pgxs/src/Makefile.global"
)

Disable readline requirement on Android/iOS. Only used in the pg binary to show command history whereas we are only interested in the library.


# Called by ITK.cmake (ExternalProject_Add) as a patch for ITK to work witk GDCM 2.0.18
# Updates library dependencies

# read whole file
file(STRINGS CMakeLists.txt sourceCode NEWLINE_CONSUME)

# substitute dependency to gdcmMSFF by dependencies for more libraries
string(REGEX REPLACE "gdcmMSFF" "gdcmMSFF gdcmDICT gdcmCommon gdcmDSED" sourceCode ${sourceCode})

# set variable CONTENTS, which is substituted in TEMPLATE_FILE
set(CONTENTS ${sourceCode})
configure_file(${TEMPLATE_FILE} CMakeLists.txt @ONLY)

# Called by ITK.cmake (ExternalProject_Add) as a patch for ITK to work witk GDCM 2.0.18

# First patch
# updates library dependencies
# read whole file CMakeLists.txt
file(STRINGS CMakeLists.txt sourceCode NEWLINE_CONSUME)

# substitute dependency to gdcmMSFF by dependencies for more libraries
string(REGEX REPLACE "gdcmMSFF" "gdcmMSFF gdcmDICT gdcmCommon gdcmDSED" sourceCode ${sourceCode})

# set variable CONTENTS, which is substituted in TEMPLATE_FILE
set(CONTENTS ${sourceCode})
configure_file(${TEMPLATE_FILE} CMakeLists.txt @ONLY)

# second patch
# read whole file
file(STRINGS Code/Common/itkLandmarkBasedTransformInitializer.h sourceCode2 NEWLINE_CONSUME)

# substitute dependency to gdcmMSFF by dependencies for more libraries
string(REGEX REPLACE "typedef typename ParametersType::ValueType +ParameterValueType;" "typedef typename TransformType::ScalarType                      ParameterValueType;" sourceCode2 ${sourceCode2})

# set variable CONTENTS, which is substituted in TEMPLATE_FILE
set(CONTENTS ${sourceCode2})
configure_file(${TEMPLATE_FILE} Code/Common/itkLandmarkBasedTransformInitializer.h @ONLY)

Patch ITK to fix LandmarkBasedTransformInitializer

This fix is already included in ITK v4 and required
by XDLFL


set(DUKTAPEDIR ${CMAKE_CURRENT_LIST_DIR}/lib/duktape)

include_directories(
  ${DUKTAPEDIR}/src
)

add_library(duktape STATIC ${DUKTAPEDIR}/src/duktape.c)

if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
  target_link_libraries(duktape
    m
  )
endif()

set(DUKTAPEDIR ${CMAKE_CURRENT_LIST_DIR}/lib/duktape)

include_directories(
  ${DUKTAPEDIR}/src
)

add_library(duktape STATIC ${DUKTAPEDIR}/src/duktape.c)

if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
  target_link_libraries(duktape
    m dl
  )
endif()

Add dl to libraries for linux

Add dl to libraries for linux


# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(BridgeNumPy
  "This module contains wrapper code to convert ITK Image's to
  NumPy array's and back.  For example:

    import itk
    ImageType = itk.Image[itk.F, 2]
    image = ImageType.New()
    array = itk.PyBuffer[ImageType].GetArrayFromImage(image)
    image = itk.PyBuffer[ImageType].GetImageFromArray(array)

  It also enables conversion of a VNL vector or matrix into a NumPy array and
  back. For example:

    import itk
    v = itk.vnl_vector[itk.F]()
    v.set_size(2)
    arr = itk.PyVnl[itk.F].GetArrayFromVnlVector(v)
    v = itk.PyVnl[itk.F].GetVnlVectorFromArray(arr)

  See http://insight-journal.org/browse/publication/85
      https://hdl.handle.net/1926/188"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKBridgeNumPy.git
  GIT_TAG 249e7be2d012c66b605498b1ce2b4b46498e0680
  )

# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(BridgeNumPy
  "This module contains wrapper code to convert ITK Image's to
  NumPy array's and back.  For example:

    import itk
    ImageType = itk.Image[itk.F, 2]
    image = ImageType.New()
    array = itk.PyBuffer[ImageType].GetArrayFromImage(image)
    image = itk.PyBuffer[ImageType].GetImageFromArray(array)

  It also enables conversion of a VNL vector or matrix into a NumPy array and
  back. For example:

    import itk
    v = itk.vnl_vector[itk.F]()
    v.set_size(2)
    arr = itk.PyVnl[itk.F].GetArrayFromVnlVector(v)
    v = itk.PyVnl[itk.F].GetVnlVectorFromArray(arr)

  See http://insight-journal.org/browse/publication/85
      https://hdl.handle.net/1926/188"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKBridgeNumPy.git
  GIT_TAG 4ad1dd6b4388071f1437dd9b652421c91f8302b8
  )

ENH: Update BridgeNumPy to most recent version (2017.02.24)

Matt McCormick (7):
      BUG: Skip NumPy tests when numpy package is not available
      Merge pull request #13 from thewtex/TestsWithoutNumPy
      ENH: Add support for Fortran contiguous in GetImageFromArray
      STYLE: Remove unnecessary obj variable
      BUG: Avoid shapeseq memory leak
      DOC: Improve axes descriptions
      Merge pull request #14 from thewtex/FortranOrder

Change-Id: I5bf4ce66dad0fd4a4c373e0a2e7980b655775a54


## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##
## # The following are required to submit to the CDash dashboard:
##   ENABLE_TESTING()
##   INCLUDE(CTest)

set(CTEST_PROJECT_NAME "geojs")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")

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

if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/build_notes.json")
  file(WRITE "${CTEST_BINARY_DIRECTORY}/build_notes.json" "")
endif()
set(CTEST_NOTES_FILES "${CTEST_BINARY_DIRECTORY}/build_notes.json")

## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##
## # The following are required to submit to the CDash dashboard:
##   ENABLE_TESTING()
##   INCLUDE(CTest)

set(CTEST_PROJECT_NAME "geojs")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")

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

if(DEFINED CTEST_BINARY_DIRECTORY AND NOT EXISTS "${CTEST_BINARY_DIRECTORY}/build_notes.json")
  file(WRITE "${CTEST_BINARY_DIRECTORY}/build_notes.json" "")
endif()
set(CTEST_NOTES_FILES "${CTEST_BINARY_DIRECTORY}/build_notes.json")

Fix submitting the build notes so that it works from travis, doesn't throw an error on buildbot, and only submits once.


CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2)

PROJECT(googlebenchmark-download NONE)

INCLUDE(ExternalProject)
ExternalProject_Add(googlebenchmark
	URL https://github.com/google/benchmark/archive/v1.2.0.zip
	URL_HASH SHA256=cc463b28cb3701a35c0855fbcefb75b29068443f1952b64dd5f4f669272e95ea
	SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark"
	BINARY_DIR "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark"
	CONFIGURE_COMMAND ""
	BUILD_COMMAND ""
	INSTALL_COMMAND ""
	TEST_COMMAND ""
)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2)

PROJECT(googlebenchmark-download NONE)

INCLUDE(ExternalProject)
ExternalProject_Add(googlebenchmark
	URL https://github.com/google/benchmark/archive/v1.5.0.zip
	URL_HASH SHA256=2d22dd3758afee43842bb504af1a8385cccb3ee1f164824e4837c1c1b04d92a0
	SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark"
	BINARY_DIR "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark"
	CONFIGURE_COMMAND ""
	BUILD_COMMAND ""
	INSTALL_COMMAND ""
	TEST_COMMAND ""
)

Update Google Benchmark in CMake builds to 1.5.0


# FindCMocka
# ----------
# Tries to find CMocka
#
# Variables:
#  CMOCKA_ROOT_DIR - Set this variable to the root installation of CMocka
#
# Read-Only variables:
#  CMOCKA_FOUND - system has CMocka
#  CMOCKA_INCLUDE_DIRS - the CMocka include directories
#  CMOCKA_INCLUDE_DIR - for backwards compatiblity, the same as CMOCKA_INCLUDE_DIRS
#  CMOCKA_LIBRARIES - Link these to use CMocka
#  CMOCKA_DEFINITIONS - Compiler switches required for using CMocka
#

include(FindPackageHandleStandardArgs)

set(CMOCKA_ROOT_DIR ${CMOCKA_ROOT_DIR} CACHE PATH "Root installation directory of CMocka")

find_path(CMOCKA_INCLUDE_DIRS
  NAMES cmocka.h
  PATHS ${CMOCKA_ROOT_DIR}/include
  NO_DEFAULT_PATH
)

find_library(CMOCKA_LIBRARY
  NAMES cmocka
  PATHS ${CMOCKA_ROOT_DIR}/lib
  NO_DEFAULT_PATH
)

set(CMOCKA_INCLUDE_DIR ${CMOCKA_INCLUDE_DIRS})

find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARY CMOCKA_INCLUDE_DIR)

mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARY)

# FindCMocka
# ----------
# Tries to find CMocka
#
# Variables:
#  CMOCKA_ROOT_DIR - Set this variable to the root installation of CMocka
#
# Read-Only variables:
#  CMOCKA_FOUND - system has CMocka
#  CMOCKA_INCLUDE_DIRS - the CMocka include directories
#  CMOCKA_INCLUDE_DIR - for backwards compatiblity, the same as CMOCKA_INCLUDE_DIRS
#  CMOCKA_LIBRARY - CMocka library location
#  CMOCKA_DEFINITIONS - Compiler switches required for using CMocka
#

include(FindPackageHandleStandardArgs)

set(CMOCKA_ROOT_DIR ${CMOCKA_ROOT_DIR} CACHE PATH "Root installation directory of CMocka")

find_path(CMOCKA_INCLUDE_DIRS
  NAMES cmocka.h
  PATHS ${CMOCKA_ROOT_DIR}/include
  NO_DEFAULT_PATH
)

find_library(CMOCKA_LIBRARY
  NAMES cmocka
  PATHS ${CMOCKA_ROOT_DIR}/lib
  NO_DEFAULT_PATH
)

set(CMOCKA_INCLUDE_DIR ${CMOCKA_INCLUDE_DIRS})

find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARY CMOCKA_INCLUDE_DIR)

mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARY)

Fix CMOCKA_LIBRARIES name in documentation


include(CheckLibraryExists)
include(CheckCXXCompilerFlag)

# Check compiler flags

check_cxx_compiler_flag(/WX                     LIBCXX_HAS_WX_FLAG)
check_cxx_compiler_flag(/WX-                    LIBCXX_HAS_NO_WX_FLAG)
check_cxx_compiler_flag(/EHsc                   LIBCXX_HAS_EHSC_FLAG)
check_cxx_compiler_flag(/EHs-                   LIBCXX_HAS_NO_EHS_FLAG)
check_cxx_compiler_flag(/EHa-                   LIBCXX_HAS_NO_EHA_FLAG)
check_cxx_compiler_flag(/GR-                    LIBCXX_HAS_NO_GR_FLAG)

# Check libraries
check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
check_library_exists(c printf "" LIBCXX_HAS_C_LIB)
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)

include(CheckLibraryExists)
include(CheckCXXCompilerFlag)

# Check compiler flags

check_cxx_compiler_flag(/WX                     LIBCXX_HAS_WX_FLAG)
check_cxx_compiler_flag(/WX-                    LIBCXX_HAS_NO_WX_FLAG)
check_cxx_compiler_flag(/EHsc                   LIBCXX_HAS_EHSC_FLAG)
check_cxx_compiler_flag(/EHs-                   LIBCXX_HAS_NO_EHS_FLAG)
check_cxx_compiler_flag(/EHa-                   LIBCXX_HAS_NO_EHA_FLAG)
check_cxx_compiler_flag(/GR-                    LIBCXX_HAS_NO_GR_FLAG)

# Check libraries
check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)

Replace cmake check for printf with a check for fopen.

Printf is a builtin, and the check fails with -Werror because of a clang
warning about an incompatible redeclaration.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@255187 91177308-0d34-0410-b5e6-96231b3b80d8


include(CheckCXXSourceCompiles)
function(check_compiles name pkgname ucpkgname includes include_dir link_libs result)
  #message(STATUS "Trying to compile ${pkgname} searching in ${include_dir} ${link_libs}")
  set(CMAKE_REQUIRED_LIBRARIES ${link_libs})
  set(CMAKE_REQUIRED_INCLUDES ${include_dir})
  set(mybody "${includes}
int main(int,char*[]) {
  ${CHECK_COMPILES_BODY}
  return 0;
}")
  set(${pkgname})
  check_cxx_source_compiles("${mybody}" "${pkgname}${name}")
  if ("${${pkgname}${name}}" MATCHES "1")
    #message(STATUS "Compiled ok")
    set(${ucpkgname}_INCLUDE_PATH ${include_dir} CACHE INTERNAL "" FORCE)
    foreach(l ${link_libs})
      set(${ucpkgname}_LIBRARIES ${${ucpkgname}_LIBRARIES} ${l} CACHE INTERNAL "" FORCE)
    endforeach()
    file(WRITE "${CMAKE_BINARY_DIR}/data/build_info/${pkgname}" "ok=True
includepath=\"${${pkgname}_INCLUDE_PATH}\"
swigpath=\"${${pkgname}_SWIG_PATH}\"
libpath=\"${${pkgname}_LIB_PATH}\"
")
    set(${result} "1" PARENT_SCOPE)
  else()
    set(${result} "0" PARENT_SCOPE)
  endif()
endfunction(check_compiles)

include(CheckCXXSourceCompiles)
function(check_compiles name pkgname ucpkgname includes include_dir link_libs result)
  #message(STATUS "Trying to compile ${pkgname} searching in ${include_dir} ${link_libs}")
  set(CMAKE_REQUIRED_LIBRARIES ${link_libs})
  set(CMAKE_REQUIRED_INCLUDES ${include_dir})
  set(mybody "${includes}
int main(int,char*[]) {
  ${CHECK_COMPILES_BODY}
  return 0;
}")
  set(${pkgname})
  check_cxx_source_compiles("${mybody}" "${pkgname}${name}")
  if ("${${pkgname}${name}}" MATCHES "1")
    #message(STATUS "Compiled ok")
    set(${ucpkgname}_INCLUDE_PATH ${include_dir} CACHE INTERNAL "" FORCE)
    foreach(l ${link_libs})
      set(${ucpkgname}_LIBRARIES ${${ucpkgname}_LIBRARIES} ${l} CACHE INTERNAL "" FORCE)
    endforeach()
    file(WRITE "${CMAKE_BINARY_DIR}/build_info/${pkgname}" "ok=True
includepath=\"${${pkgname}_INCLUDE_PATH}\"
swigpath=\"${${pkgname}_SWIG_PATH}\"
libpath=\"${${pkgname}_LIB_PATH}\"
")
    set(${result} "1" PARENT_SCOPE)
  else()
    set(${result} "0" PARENT_SCOPE)
  endif()
endfunction(check_compiles)

Move build_info out of data directory

Move build_info out of data directory

build_info is architecture-dependent, and
really belongs in the binary directory, whereas
the data files are arch-independent. Put them
in separate directories to make it easier to
separate them at install time.


include(CMakeFindDependencyMacro)
find_dependency(
  Ogg
  Opus
)

# TODO: include(...opusfileTargets-debug.cmake)?
include("${CMAKE_CURRENT_LIST_DIR}/opusfileTargets.cmake")

include(CMakeFindDependencyMacro)
find_dependency(
  Ogg
  Opus
)

include("${CMAKE_CURRENT_LIST_DIR}/opusfileTargets.cmake")

# Load information for each installed configuration.
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(GLOB CONFIG_FILES "${_DIR}/opusfileTargets-*.cmake")
foreach(f ${CONFIG_FILES})
  include(${f})
endforeach()

Include targets from all configurations

Include targets from all configurations

Signed-off-by: Ralph Giles <65585f72bf62a11d2f4105aa30c20fe94efea46f@thaumas.net>
Signed-off-by: evpobr <5e0e5824270792833773a279da5678ebbd548119@gmail.com>


set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "sfeMovie SDK")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/License.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/ReadMe.txt")

set(CPACK_PACKAGE_VERSION_MAJOR "2")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")

if (NOT WINDOWS)
	set(CPACK_SET_DESTDIR TRUE)
endif()

set(CPACK_COMPONENTS_ALL doxygen binaries libraries resources)

include(CPack)

set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "sfeMovie SDK")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/License.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/ReadMe.txt")

set(CPACK_PACKAGE_VERSION_MAJOR "2")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_NAME "${SFEMOVIE_LIB}-${CMAKE_BUILD_TYPE}")

if (NOT WINDOWS)
	set(CPACK_SET_DESTDIR TRUE)
endif()

set(CPACK_COMPONENTS_ALL doxygen binaries libraries resources)

include(CPack)

Add build type in package name

Add build type in package name


# Copyright (c) 2014, Ruslan Baratov
# All rights reserved.

if(DEFINED POLLY_SANITIZE_ADDRESS_CMAKE_)
  return()
else()
  set(POLLY_SANITIZE_ADDRESS_CMAKE_ 1)
endif()

set(
    POLLY_TOOLCHAIN_NAME
    "Clang address sanitizer / c++11 support"
)
set(POLLY_TOOLCHAIN_TAG "sanitize_address")

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

include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address.cmake")

set(HUNTER_DISABLE_SHARED_LIBS YES)

Set HUNTER_DISABLE_SHARED_LIBS to YES for address sanitizer


# Try to find the DepthSense SDK For SoftKinetic Cameras
#
# DepthSense_INCLUDE_DIRS
# DepthSense_LIBRARIES
# DepthSense_FOUND

FIND_PATH( DepthSense_INCLUDE_DIR DepthSense.hxx
  PATHS
      "$ENV{PROGRAMFILES}/SoftKinetic/DepthSenseSDK/include"
      /usr/include
      /usr/local/include
      /opt/local/include
      /opt/softkinetic/DepthSenseSDK/include
)

FIND_LIBRARY( DepthSense_LIBRARY DepthSense
  PATHS
      "$ENV{PROGRAMFILES}/SoftKinetic/DepthSenseSDK/lib"
      /usr/lib64
      /usr/lib
      /usr/local/lib
      /opt/local/lib
      /opt/softkinetic/DepthSenseSDK/lib
)

IF(DepthSense_INCLUDE_DIR AND DepthSense_LIBRARY)
  SET( DepthSense_FOUND TRUE )
  SET( DepthSense_LIBRARIES ${DepthSense_LIBRARY} )
  SET( DepthSense_INCLUDE_DIRS ${DepthSense_INCLUDE_DIR} )
ENDIF()

IF(DepthSense_FOUND)
   IF(NOT DepthSense_FIND_QUIETLY)
      MESSAGE(STATUS "Found DepthSense: ${DepthSense_LIBRARY}")
   ENDIF()
ELSE()
   IF(DepthSense_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find DepthSense")
   ENDIF()
ENDIF()

# Try to find the DepthSense SDK For SoftKinetic Cameras
#
# DepthSense_INCLUDE_DIRS
# DepthSense_LIBRARIES
# DepthSense_FOUND

FIND_PATH( DepthSense_INCLUDE_DIR DepthSense.hxx
  PATHS
      "$ENV{PROGRAMFILES}/SoftKinetic/DepthSenseSDK/include"
      "$ENV{PROGRAMFILES}/Meta/DepthSenseSDK/include"
      /usr/include
      /usr/local/include
      /opt/local/include
      /opt/softkinetic/DepthSenseSDK/include
)

FIND_LIBRARY( DepthSense_LIBRARY DepthSense
  PATHS
      "$ENV{PROGRAMFILES}/SoftKinetic/DepthSenseSDK/lib"
      "$ENV{PROGRAMFILES}/Meta/DepthSenseSDK/lib"
      /usr/lib64
      /usr/lib
      /usr/local/lib
      /opt/local/lib
      /opt/softkinetic/DepthSenseSDK/lib
)

IF(DepthSense_INCLUDE_DIR AND DepthSense_LIBRARY)
  SET( DepthSense_FOUND TRUE )
  SET( DepthSense_LIBRARIES ${DepthSense_LIBRARY} )
  SET( DepthSense_INCLUDE_DIRS ${DepthSense_INCLUDE_DIR} )
ENDIF()

IF(DepthSense_FOUND)
   IF(NOT DepthSense_FIND_QUIETLY)
      MESSAGE(STATUS "Found DepthSense: ${DepthSense_LIBRARY}")
   ENDIF()
ELSE()
   IF(DepthSense_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find DepthSense")
   ENDIF()
ENDIF()

Add possible Depthsense SDK FindPackage location.


if(NOT __EXTERNAL_SHARK__)
set(__EXTERNAL_SHARK__ 1)

if(USE_SYSTEM_SHARK)
  message(STATUS "  Using SHARK system version")
else()
  SETUP_SUPERBUILD(PROJECT SHARK)
  cmake_minimum_required(VERSION 3.1)
  message(STATUS "  Using SHARK SuperBuild version")

  # declare dependencies
  ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(SHARK BOOST)

  ADD_SUPERBUILD_CMAKE_VAR(SHARK Boost_INCLUDE_DIR)
  ADD_SUPERBUILD_CMAKE_VAR(SHARK Boost_LIBRARY_DIR)

  ExternalProject_Add(SHARK
    PREFIX SHARK
    GIT_REPOSITORY "https://github.com/inglada/Shark.git"
    GIT_TAG "master"
    SOURCE_DIR ${SHARK_SB_SRC}
    BINARY_DIR ${SHARK_SB_BUILD_DIR}
    INSTALL_DIR ${SB_INSTALL_PREFIX}
    DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
    CMAKE_CACHE_ARGS
      -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
      -DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
      -DCMAKE_BUILD_TYPE:STRING=Release
      -DBUILD_SHARED_LIBS:BOOL=ON
      -DBUILD_DOCS:BOOL=OFF
      -DBUILD_EXAMPLES:BOOL=OFF
      -DBUILD_TESTING:BOOL=OFF
      -DENABLE_HDF5:BOOL=OFF
      CMAKE_COMMAND ${SB_CMAKE_COMMAND}
    )
  set(_SB_SHARK_DIR ${SB_INSTALL_PREFIX}/share/SHARK)
endif()
endif()

if(NOT __EXTERNAL_SHARK__)
set(__EXTERNAL_SHARK__ 1)

if(USE_SYSTEM_SHARK)
  message(STATUS "  Using SHARK system version")
else()
  SETUP_SUPERBUILD(PROJECT SHARK)
  cmake_minimum_required(VERSION 3.1)
  message(STATUS "  Using SHARK SuperBuild version")

  # declare dependencies
  ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(SHARK BOOST)

  ADD_SUPERBUILD_CMAKE_VAR(SHARK Boost_INCLUDE_DIR)
  ADD_SUPERBUILD_CMAKE_VAR(SHARK Boost_LIBRARY_DIR)

  ExternalProject_Add(SHARK
    PREFIX SHARK
    GIT_REPOSITORY "https://github.com/Shark-ML/Shark/"
    GIT_TAG "master"
    SOURCE_DIR ${SHARK_SB_SRC}
    BINARY_DIR ${SHARK_SB_BUILD_DIR}
    INSTALL_DIR ${SB_INSTALL_PREFIX}
    DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
    CMAKE_CACHE_ARGS
      -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
      -DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
      -DCMAKE_BUILD_TYPE:STRING=Release
      -DBUILD_SHARED_LIBS:BOOL=ON
      -DBUILD_DOCS:BOOL=OFF
      -DBUILD_EXAMPLES:BOOL=OFF
      -DBUILD_TESTING:BOOL=OFF
      -DENABLE_HDF5:BOOL=OFF
      CMAKE_COMMAND ${SB_CMAKE_COMMAND}
    )
  set(_SB_SHARK_DIR ${SB_INSTALL_PREFIX}/share/SHARK)
endif()
endif()

COMP: Change superbuild version to official shark repo on github


set(CTEST_PROJECT_NAME "dsnutil")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

if(NOT DEFINED CTEST_DROP_METHOD)
  set(CTEST_DROP_METHOD "http")
endif(NOT DEFINED CTEST_DROP_METHOD)

if(CTEST_DROP_METHOD STREQUAL "http")
  set(CTEST_DROP_SITE "harpy.png.das-system.vpn")
  set(CTEST_DROP_LOCATION "/cdash/submit.php?project=dsnutil")
  set(CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/")
endif(CTEST_DROP_METHOD STREQUAL "http")

set(CTEST_PROJECT_NAME "dsnutil")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

if(NOT DEFINED CTEST_DROP_METHOD)
  set(CTEST_DROP_METHOD "http")
endif(NOT DEFINED CTEST_DROP_METHOD)

if(CTEST_DROP_METHOD STREQUAL "http")
  set(CTEST_DROP_SITE "cdash.das-system-networks.de")
  set(CTEST_DROP_LOCATION "/submit.php?project=dsnutil")
  set(CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/")
endif(CTEST_DROP_METHOD STREQUAL "http")

Update CTest configuration for cdash.das-system-networks.de

Signed-off-by: Peter Hille (png!das-system) <4b8373d016f277527198385ba72fda0feb5da015@das-system-networks.de>


#
# Try to find the wireshark library and its includes
#
# This snippet sets the following variables:
#  WIRESHARK_FOUND             True if wireshark library got found
#  WIRESHARK_INCLUDE_DIRS      Location of the wireshark headers
#  WIRESHARK_LIBRARIES         List of libraries to use wireshark
#
#  Copyright (c) 2011 Reinhold Kainhofer <reinhold@kainhofer.com>
#
#  Redistribution and use is allowed according to the terms of the New
#  BSD license.
#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#

# wireshark does not install its library with pkg-config information,
# so we need to manually find the libraries and headers

FIND_PATH( WIRESHARK_INCLUDE_DIRS epan/column-info.h PATH_SUFFIXES wireshark )
FIND_LIBRARY( WIRESHARK_LIBRARIES wireshark )

# Report results
IF ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )
  SET( WIRESHARK_FOUND 1 )
ELSE ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )
  MESSAGE( SEND_ERROR "Could NOT find the wireshark library and headers" )
ENDIF ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )

IF (WIRESHARK_FOUND)
  MESSAGE (STATUS "Found wireshark libs at ${WIRESHARK_INCLUDE_DIRS}")
ELSE()
  MESSAGE (STATUS "Wireshark libs not found!")
ENDIF()

#
# Try to find the wireshark library and its includes
#
# This snippet sets the following variables:
#  WIRESHARK_FOUND             True if wireshark library got found
#  WIRESHARK_INCLUDE_DIRS      Location of the wireshark headers
#  WIRESHARK_LIBRARIES         List of libraries to use wireshark
#
#  Copyright (c) 2011 Reinhold Kainhofer <reinhold@kainhofer.com>
#
#  Redistribution and use is allowed according to the terms of the New
#  BSD license.
#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#

# wireshark does not install its library with pkg-config information,
# so we need to manually find the libraries and headers

FIND_PATH( WIRESHARK_INCLUDE_DIRS epan/column_info.h PATH_SUFFIXES wireshark )
FIND_PATH( WIRESHARK_INCLUDE_DIRS epan/column-info.h PATH_SUFFIXES wireshark )
FIND_LIBRARY( WIRESHARK_LIBRARIES wireshark )

# Report results
IF ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )
  SET( WIRESHARK_FOUND 1 )
ELSE ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )
  MESSAGE( SEND_ERROR "Could NOT find the wireshark library and headers" )
ENDIF ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )

IF (WIRESHARK_FOUND)
  MESSAGE (STATUS "Found wireshark libs at ${WIRESHARK_INCLUDE_DIRS}")
ELSE()
  MESSAGE (STATUS "Wireshark libs not found!")
ENDIF()

Handle filename changed in Wireshark source tree

epan/column_info.h renamed in epan/column-info.h


# This file allows users to call find_package(Cling) and pick up our targets.

# Cling doesn't have any CMake configuration settings yet because it mostly
# uses LLVM's. When it does, we should move this file to ClingConfig.cmake.in
# and call configure_file() on it.

find_package(LLVM REQUIRED CONFIG)

# Provide all our library targets to users.
include("${CMAKE_CURRENT_LIST_DIR}/ClingTargets.cmake")

# This file allows users to call find_package(Cling) and pick up our targets.

# Cling doesn't have any CMake configuration settings yet because it mostly
# uses LLVM's. When it does, we should move this file to ClingConfig.cmake.in
# and call configure_file() on it.

# Don't just use any llvm / clang: cling needs its own:
find_package(LLVM REQUIRED CONFIG NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_LIST_DIR}/../llvm")
find_package(clang REQUIRED CONFIG NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_LIST_DIR}/../clang")

# Provide all our library targets to users.
include("${CMAKE_CURRENT_LIST_DIR}/ClingTargets.cmake")

Use llvm and clang of cling.

Use llvm and clang of cling.


# Build type configuration
if (NOT CMAKE_BUILD_TYPE)
	message(STATUS "No build type selected, default to Release.")
	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()

# General settings
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/Shared/CMake/modules/")
set(ConfigPackageLocation share/cmake/Jamoma)

# Jamoma configuration
set(Jamoma_VERSION 0.6)
set(Jamoma_SOVERSION 6)
set(Jamoma_MAJOR_VERSION 6)

# Build type configuration
if (NOT CMAKE_BUILD_TYPE)
	message(STATUS "No build type selected, default to Release.")
	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()

# General settings
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/Shared/CMake/modules/")
set(ConfigPackageLocation share/cmake/Jamoma)

# Jamoma configuration
set(Jamoma_VERSION 6)
set(Jamoma_SOVERSION 6)
set(Jamoma_MAJOR_VERSION 6)

Use whole numbers for dynamic libraries versioning


# Find Metis library

if (NOT (METIS_INCLUDE_DIRS AND METIS_LIBRARIES))
    find_path(METIS_INCLUDE_DIRS
        NAMES metis.h parmetis.h
        PATHS $ENV{METIS_ROOT}
        PATH_SUFFIXES metis
        )

    find_library(METIS_LIBRARY    metis    PATHS $ENV{METIS_ROOT})
    find_library(PARMETIS_LIBRARY parmetis PATHS $ENV{METIS_ROOT})

    set(METIS_LIBRARIES "${PARMETIS_LIBRARY};${METIS_LIBRARY}")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
    METIS DEFAULT_MSG METIS_INCLUDE_DIRS METIS_LIBRARIES)

mark_as_advanced(METIS_INCLUDE_DIRS METIS_LIBRARIES)

if (METIS_FOUND)
    add_library(Metis_metis INTERFACE)
    add_library(Metis::metis ALIAS Metis_metis)
    target_include_directories(Metis_metis INTERFACE ${METIS_INCLUDE_DIRS})
    target_link_libraries(Metis_metis INTERFACE ${METIS_LIBRARIES})

    if (METIS_LIBRARY)
        target_compile_definitions(Metis_metis INTERFACE AMGCL_HAVE_METIS)
    endif()

    if (PARMETIS_LIBRARY)
        target_compile_definitions(Metis_metis INTERFACE AMGCL_HAVE_PARMETIS)
    endif()
endif()

# Find Metis library

if (NOT (METIS_INCLUDE_DIRS AND METIS_LIBRARIES))
    find_path(METIS_INCLUDE_DIRS
        NAMES metis.h parmetis.h
        PATHS $ENV{METIS_ROOT}
        PATH_SUFFIXES metis include
        )

    find_library(METIS_LIBRARY metis
        PATHS $ENV{METIS_ROOT}
        PATH_SUFFIXES lib
        )

    find_library(PARMETIS_LIBRARY parmetis
        PATHS $ENV{METIS_ROOT}
        PATH_SUFFIXES lib
        )

    set(METIS_LIBRARIES "${PARMETIS_LIBRARY};${METIS_LIBRARY}")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
    METIS DEFAULT_MSG METIS_INCLUDE_DIRS METIS_LIBRARIES)

mark_as_advanced(METIS_INCLUDE_DIRS METIS_LIBRARIES)

if (METIS_FOUND)
    add_library(Metis_metis INTERFACE)
    add_library(Metis::metis ALIAS Metis_metis)
    target_include_directories(Metis_metis INTERFACE ${METIS_INCLUDE_DIRS})
    target_link_libraries(Metis_metis INTERFACE ${METIS_LIBRARIES})

    if (METIS_LIBRARY)
        target_compile_definitions(Metis_metis INTERFACE AMGCL_HAVE_METIS)
    endif()

    if (PARMETIS_LIBRARY)
        target_compile_definitions(Metis_metis INTERFACE AMGCL_HAVE_PARMETIS)
    endif()
endif()

Add path suffixes for metis

Add path suffixes for metis


# - Try to find Gluon's common files
#
# Once done this will define
#  GLUONCOMMON_FOUND - system has Gluon common files
#  GLUONCOMMON_INCLUDES - all include directories required for Gluon's common files, use it with KDE4_INCLUDES
#  GLUONCOMMON_INCLUDE_DIR - the Gluon common include directory
#
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (GLUONCOMMON_LIBRARY AND GLUONCOMMON_INCLUDE_DIR)
  # Already in cache, be silent
  set(GLUONCOMMON_FOUND TRUE)
endif (GLUONCOMMON_LIBRARY AND GLUONCOMMON_INCLUDE_DIR)

if (GluonCommon_FIND_REQUIRED)
    set(_gluonCommonReq "REQUIRED")
endif (GluonCommon_FIND_REQUIRED)

find_path(GLUONCOMMON_INCLUDE_DIR
    NAMES
    common/ksingleton.h
    PATHS
    ${INCLUDE_INSTALL_DIR}/gluon
)

set(GLUONCOMMON_INCLUDES
    ${GLUONCOMMON_INCLUDE_DIR}
    CACHE STRING "Common files for Gluon"
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GluonCommon DEFAULT_MSG GLUONCOMMON_INCLUDE_DIR)

# - Try to find Gluon's common files
#
# Once done this will define
#  GLUONCOMMON_FOUND - system has Gluon common files
#  GLUONCOMMON_INCLUDES - all include directories required for Gluon's common files, use it with KDE4_INCLUDES
#  GLUONCOMMON_INCLUDE_DIR - the Gluon common include directory
#
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (GLUONCOMMON_LIBRARY AND GLUONCOMMON_INCLUDE_DIR)
  # Already in cache, be silent
  set(GLUONCOMMON_FOUND TRUE)
endif (GLUONCOMMON_LIBRARY AND GLUONCOMMON_INCLUDE_DIR)

if (GluonCommon_FIND_REQUIRED)
    set(_gluonCommonReq "REQUIRED")
endif (GluonCommon_FIND_REQUIRED)

find_path(GLUONCOMMON_INCLUDE_DIR
    NAMES
    gluon/common/ksingleton.h
    PATHS
    ${INCLUDE_INSTALL_DIR}
)

set(GLUONCOMMON_INCLUDES
    ${GLUONCOMMON_INCLUDE_DIR}/gluon
    CACHE STRING "Common files for Gluon"
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GluonCommon DEFAULT_MSG GLUONCOMMON_INCLUDES)

Allow GluonCommon CMake module to find it correctly when Gluon is installed outside of KDEDIR


set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7)

set(CMAKE_C_COMPILER arm-linux-gnueabihf-g++-8)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++-8)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7)

set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc-8)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++-8)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

Fix typo of C compiler name in armv7 script.


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

set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE} tutorial-pyroot-zdemo)

if("$ENV{COMPILER}" STREQUAL "classic") #  TTreeProcessorM{T,P} are not available
  list(APPEND CTEST_CUSTOM_TESTS_IGNORE tutorial-multicore-mp102_readNtuplesFillHistosAndFit)
endif()

if (CTEST_BUILD_NAME MATCHES aarch64 AND CTEST_BUILD_NAME MATCHES dbg)
  # these tutorials are disabled as they timeout
  list(APPEND CTEST_CUSTOM_TESTS_IGNORE
       tutorial-roostats-StandardBayesianNumericalDemo
       tutorial-roostats-OneSidedFrequentistUpperLimitWithBands
       tutorial-tmva-TMVAClassification
       tutorial-tmva-TMVARegression
       tutorial-tmva-TMVAMulticlass
       tutorial-tmva-TMVAMulticlassApplication
       tutorial-tmva-TMVARegressionApplication
       tutorial-tmva-TMVAClassificationApplication
       tutorial-roostats-TwoSidedFrequentistUpperLimitWithBands)
endif()

if (CTEST_BUILD_NAME MATCHES aarch64)
  # The new triangulation does not work on ARM
  list(APPEND CTEST_CUSTOM_TESTS_IGNORE tutorial-mlp-mlpRegression)
endif()

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

set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE} tutorial-pyroot-zdemo)

if("$ENV{COMPILER}" STREQUAL "classic")
  #  TTreeProcessorM{T,P} are not available
  list(APPEND CTEST_CUSTOM_TESTS_IGNORE tutorial-multicore-mp102_readNtuplesFillHistosAndFit)
  #  pthread is not retained on ubuntus when building root.exe
  list(APPEND CTEST_CUSTOM_TESTS_IGNORE
       tutorial-multicore-mt101_fillNtuples
       tutorial-multicore-mt001_fillHistos
       tutorial-multicore-mt201_parallelHistoFill)
endif()

if (CTEST_BUILD_NAME MATCHES aarch64 AND CTEST_BUILD_NAME MATCHES dbg)
  # these tutorials are disabled as they timeout
  list(APPEND CTEST_CUSTOM_TESTS_IGNORE
       tutorial-roostats-StandardBayesianNumericalDemo
       tutorial-roostats-OneSidedFrequentistUpperLimitWithBands
       tutorial-tmva-TMVAClassification
       tutorial-tmva-TMVARegression
       tutorial-tmva-TMVAMulticlass
       tutorial-tmva-TMVAMulticlassApplication
       tutorial-tmva-TMVARegressionApplication
       tutorial-tmva-TMVAClassificationApplication
       tutorial-roostats-TwoSidedFrequentistUpperLimitWithBands)
endif()

if (CTEST_BUILD_NAME MATCHES aarch64)
  # The new triangulation does not work on ARM
  list(APPEND CTEST_CUSTOM_TESTS_IGNORE tutorial-mlp-mlpRegression)
endif()

Remove some imt tutorials from the test batteries for classic builds

on ubuntus, despite the usage of -pthread, the executable root.exe
is not linked to libpthread: the -Wl,--as-needed flag is being specified.
As a result, the usage of any thread in a macro results in a crash.


INCLUDE(ExternalProject)

SET(prefix ${CMAKE_BINARY_DIR}/third_party/cl2hpp)

ExternalProject_Add(
    cl2hpp-ext
    GIT_REPOSITORY https://github.com/9prady9/OpenCL-CLHPP.git
    GIT_TAG install_targets
    PREFIX "${prefix}"
    INSTALL_DIR "${prefix}/package"
    UPDATE_COMMAND ""
    CONFIGURE_COMMAND ${CMAKE_COMMAND} -Wno-dev "-G${CMAKE_GENERATOR}" <SOURCE_DIR>
    -DCMAKE_SOURCE_DIR:PATH=<SOURCE_DIR>
    -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
    -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
    -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
    -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
    -DBUILD_DOCS:BOOL=OFF
    -DBUILD_EXAMPLES:BOOL=OFF
    -DBUILD_TESTS:BOOL=OFF
    )

ExternalProject_Get_Property(cl2hpp-ext install_dir)

ADD_CUSTOM_TARGET(cl2hpp DEPENDS "${prefix}/package/CL/cl2.hpp")

ADD_DEPENDENCIES(cl2hpp cl2hpp-ext)

SET(CL2HPP_INCLUDE_DIRECTORY ${install_dir})

INCLUDE(ExternalProject)

SET(prefix ${CMAKE_BINARY_DIR}/third_party/cl2hpp)

ExternalProject_Add(
    cl2hpp-ext
    GIT_REPOSITORY https://github.com/arrayfire/OpenCL-CLHPP.git
    GIT_TAG install_targets
    PREFIX "${prefix}"
    INSTALL_DIR "${prefix}/package"
    UPDATE_COMMAND ""
    CONFIGURE_COMMAND ${CMAKE_COMMAND} -Wno-dev "-G${CMAKE_GENERATOR}" <SOURCE_DIR>
    -DCMAKE_SOURCE_DIR:PATH=<SOURCE_DIR>
    -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
    -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
    -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
    -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
    -DBUILD_DOCS:BOOL=OFF
    -DBUILD_EXAMPLES:BOOL=OFF
    -DBUILD_TESTS:BOOL=OFF
    )

ExternalProject_Get_Property(cl2hpp-ext install_dir)

ADD_CUSTOM_TARGET(cl2hpp DEPENDS "${prefix}/package/CL/cl2.hpp")

ADD_DEPENDENCIES(cl2hpp cl2hpp-ext)

SET(CL2HPP_INCLUDE_DIRECTORY ${install_dir})

Change cl2hpp external project github url


# 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/.

set(ENV{LANG} "C")
set(ENV{BUILD_DIR} ${CTEST_MODULE_DIR})
set(ENV{LUA_PATH} ${PROJECT_SOURCE_DIR}/src/lua/?.lua)
set(ENV{HAKA_PATH} ${TEST_RUNDIR}/${HAKA_INSTALL_PREFIX})
set(ENV{LD_LIBRARY_PATH} ${TEST_RUNDIR}/${HAKA_INSTALL_PREFIX}/lib)
set(ENV{TZ} Europe/Paris)

set(CMAKE_MODULE_PATH ${CTEST_MODULE_DIR} ${CMAKE_MODULE_PATH})
include(Valgrind)

message("Executing TZ=\"Europe/Paris\" LANG=\"C\" LUA_PATH=\"$ENV{LUA_PATH}\" HAKA_PATH=\"$ENV{HAKA_PATH}\" LD_LIBRARY_PATH=\"$ENV{LD_LIBRARY_PATH}\" ${EXE}")

VALGRIND(${DST} --show-reachable=yes ${EXE} RESULT_VARIABLE HAD_ERROR OUTPUT_FILE ${DST}-tmp.txt)

execute_process(COMMAND cat ${DST}-tmp.txt OUTPUT_VARIABLE CONTENT)
message("${CONTENT}")

if(HAD_ERROR)
	message(FATAL_ERROR "Unit test failed")
endif(HAD_ERROR)

# Memory leak
CHECK_VALGRIND(${DST})

# 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/.

set(ENV{LANG} "C")
set(ENV{BUILD_DIR} ${CTEST_MODULE_DIR})
set(ENV{LUA_PATH} ${PROJECT_SOURCE_DIR}/src/lua/?.lua)
set(ENV{HAKA_PATH} ${TEST_RUNDIR}/${HAKA_INSTALL_PREFIX})
set(ENV{LD_LIBRARY_PATH} ${TEST_RUNDIR}/${HAKA_INSTALL_PREFIX}/lib)
set(ENV{TZ} Europe/Paris)

set(CMAKE_MODULE_PATH ${CTEST_MODULE_DIR} ${CMAKE_MODULE_PATH})
include(Valgrind)

message("Executing TZ=\"Europe/Paris\" LANG=\"C\" LUA_PATH=\"$ENV{LUA_PATH}\" HAKA_PATH=\"$ENV{HAKA_PATH}\" LD_LIBRARY_PATH=\"$ENV{LD_LIBRARY_PATH}\" ${EXE}")

VALGRIND(${DST} ${EXE} RESULT_VARIABLE HAD_ERROR OUTPUT_FILE ${DST}-tmp.txt)

execute_process(COMMAND cat ${DST}-tmp.txt OUTPUT_VARIABLE CONTENT)
message("${CONTENT}")

if(HAD_ERROR)
	message(FATAL_ERROR "Unit test failed")
endif(HAD_ERROR)

# Memory leak
CHECK_VALGRIND(${DST})

Fix cunit test without valdgrind

Fix cunit test without valdgrind


# 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/;.")

# 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 "v${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/;.")

Change naming of packaged tarballs to match tag naming scheme - this should fix deployment to CVMFS


# VTK detection for Salome (see http://www.vtk.org/Wiki/VTK/Build_System_Migration)

set(PARAVIEW_ROOT_DIR $ENV{PARAVIEW_ROOT_DIR} CACHE PATH "Path to ParaView directory")
set(PARAVIEW_VERSION $ENV{PARAVIEW_VERSION} CACHE STRING "Version of Paraview")
if(EXISTS ${PARAVIEW_ROOT_DIR})
  set(VTK_DIR ${PARAVIEW_ROOT_DIR}/lib/cmake/paraview-${PARAVIEW_VERSION} CACHE PATH "Path to directory including VTKConfig.cmake")
endif(EXISTS ${PARAVIEW_ROOT_DIR})
set(VTK_COMPONENTS vtkRenderingOpenGL vtkRenderingLOD vtkRenderingAnnotation vtkFiltersParallel vtkIOExport)
find_package(VTK 6.0 REQUIRED COMPONENTS ${VTK_COMPONENTS} NO_MODULE)
if (VTK_FOUND)
  message(STATUS "VTK version is ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
  message(STATUS "VTK libraries are: ${VTK_LIBRARIES}")
endif(VTK_FOUND)

# VTK detection for Salome (see http://www.vtk.org/Wiki/VTK/Build_System_Migration)

set(PARAVIEW_ROOT_DIR $ENV{PARAVIEW_ROOT_DIR} CACHE PATH "Path to ParaView directory")
set(PARAVIEW_VERSION $ENV{PARAVIEW_VERSION} CACHE STRING "Version of Paraview")
if(EXISTS ${PARAVIEW_ROOT_DIR})
  set(VTK_DIR ${PARAVIEW_ROOT_DIR}/lib/cmake/paraview-${PARAVIEW_VERSION} CACHE PATH "Path to directory including VTKConfig.cmake")
endif(EXISTS ${PARAVIEW_ROOT_DIR})
set(VTK_COMPONENTS vtkRenderingFreeTypeOpenGL vtkRenderingLOD vtkRenderingAnnotation vtkFiltersParallel vtkIOExport)
find_package(VTK 6.0 REQUIRED COMPONENTS ${VTK_COMPONENTS} NO_MODULE)
if (VTK_FOUND)
  message(STATUS "VTK version is ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
  message(STATUS "VTK libraries are: ${VTK_LIBRARIES}")
endif(VTK_FOUND)

Fix VTKViewer when compiled with CMake (add missing VTK component)


set( DOCUMENTATION "This module contains ImageIO classes for reading microscopy
images (mostly TIFF based) readable by the OpenSlide library,
http://openslide.org.")

itk_module( IOOpenSlide
  DEPENDS
    ITKIOImageBase
  TEST_DEPENDS
    ITKTestKernel
  ENABLE_SHARED
  DESCRIPTION
    "${DOCUMENTATION}"
  EXCLUDE_FROM_DEFAULT
)

set( DOCUMENTATION "This module contains ImageIO classes for reading microscopy
images (mostly TIFF based) readable by the OpenSlide library,
http://openslide.org.")

itk_module( IOOpenSlide
  DEPENDS
    ITKIOImageBase
  TEST_DEPENDS
    ITKTestKernel
  ENABLE_SHARED
  FACTORY_NAMES
    ImageIO::OpenSlide
  DESCRIPTION
    "${DOCUMENTATION}"
  EXCLUDE_FROM_DEFAULT
)

ENH: Add FACTORY_NAMES parameter to itk_module() declaration

This new parameter allows ITK to be aware any object that needs to be registered
to the ITK factory. Remote modules that offer IO capabilities can be more easily
integrated in ITK.


# This config script tries to locate the project either in its source tree
# or from an install location.
#
# Please adjust the list of submodules to search for.

# List of modules
set(MODULE_NAMES
    glbinding
)

# Macro to search for a specific module
macro(find_module FILENAME)
    if(EXISTS "${FILENAME}")
        set(MODULE_FOUND TRUE)
        include("${FILENAME}")
    endif()
endmacro()

# Macro to search for all modules
macro(find_modules PREFIX)
    foreach(module_name ${MODULE_NAMES})
        if(TARGET ${module_name})
            set(MODULE_FOUND TRUE)
        else()
            find_module("${CMAKE_CURRENT_LIST_DIR}/${PREFIX}/${module_name}/${module_name}-export.cmake")
        endif()
    endforeach(module_name)
endmacro()

# Try install location
set(MODULE_FOUND FALSE)
find_modules("cmake")

if(MODULE_FOUND)
    return()
endif()

# Try common build locations
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
    find_modules("build-debug/cmake")
    find_modules("build/cmake")
else()
    find_modules("build/cmake")
    find_modules("build-debug/cmake")
endif()

# Signal success/failure to CMake
set(glbinding_FOUND ${MODULE_FOUND})

# This config script tries to locate the project either in its source tree
# or from an install location.
#
# Please adjust the list of submodules to search for.

# List of modules
set(MODULE_NAMES
    glbinding
    glbinding-aux
)

# Macro to search for a specific module
macro(find_module FILENAME)
    if(EXISTS "${FILENAME}")
        set(MODULE_FOUND TRUE)
        include("${FILENAME}")
    endif()
endmacro()

# Macro to search for all modules
macro(find_modules PREFIX)
    foreach(module_name ${MODULE_NAMES})
        if(TARGET ${module_name})
            set(MODULE_FOUND TRUE)
        else()
            find_module("${CMAKE_CURRENT_LIST_DIR}/${PREFIX}/${module_name}/${module_name}-export.cmake")
        endif()
    endforeach(module_name)
endmacro()

# Try install location
set(MODULE_FOUND FALSE)
find_modules("cmake")

if(MODULE_FOUND)
    return()
endif()

# Try common build locations
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
    find_modules("build-debug/cmake")
    find_modules("build/cmake")
else()
    find_modules("build/cmake")
    find_modules("build-debug/cmake")
endif()

# Signal success/failure to CMake
set(glbinding_FOUND ${MODULE_FOUND})

Add aux module to configure script

Add aux module to configure script


set(DOCUMENTATION "The modules provides filters may be particularly useful for
ultrasound image reconstruction and analysis.")

# A library is only created when FFTW support is ON
set(_fft_depends ITKFFT)
if(ITK_USE_FFTWF OR ITK_USE_FFTWD)
  set(_fft_depends ITKFFT)
endif()

itk_module(Ultrasound
  DEPENDS
    ITKImageCompose
    ITKImageIntensity
    ITKIOImageBase
    ITKTransform
    ITKRegistrationCommon
    ${_fft_depends}
  COMPILE_DEPENDS
    SplitComponents
  PRIVATE_DEPENDS
    ITKHDF5
  TEST_DEPENDS
    ITKTransform
    ITKTestKernel
    ITKImageSources
    ${_fft_depends}
  EXCLUDE_FROM_DEFAULT
  ENABLE_SHARED
  DESCRIPTION
    "${DOCUMENTATION}"
  )

set(DOCUMENTATION "The modules provides filters may be particularly useful for
ultrasound image reconstruction and analysis.")

# A library is only created when FFTW support is ON
set(_fft_depends ITKFFT)
if(ITK_USE_FFTWF OR ITK_USE_FFTWD)
  set(_fft_depends ITKFFT)
endif()

itk_module(Ultrasound
  DEPENDS
    ITKImageCompose
    ITKImageIntensity
    ITKIOImageBase
    ITKTransform
    ITKRegistrationCommon
    ${_fft_depends}
  COMPILE_DEPENDS
    SplitComponents
    BSplineGradient
  PRIVATE_DEPENDS
    ITKHDF5
  TEST_DEPENDS
    ITKTransform
    ITKTestKernel
    ITKImageSources
    ${_fft_depends}
  EXCLUDE_FROM_DEFAULT
  ENABLE_SHARED
  DESCRIPTION
    "${DOCUMENTATION}"
  )

COMP: Add BSplineGradient module as a dependency

For itkBSplineApproximationGradientImageFilter.h


include(GNUInstallDirs)
prusaslicer_add_cmake_project(Qhull
    URL "https://github.com/qhull/qhull/archive/v8.0.0.zip"
    URL_HASH SHA256=7edae57142989690bc432893da47db5b7069a150c82ba113e46977904ca326ef
    CMAKE_ARGS
        -DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR}
)

if (MSVC)
    add_debug_dep(dep_Qhull)
endif ()

include(GNUInstallDirs)
prusaslicer_add_cmake_project(Qhull
    URL "https://github.com/qhull/qhull/archive/v8.0.1.zip"
    URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b
    CMAKE_ARGS
        -DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR}
)

if (MSVC)
    add_debug_dep(dep_Qhull)
endif ()

Fix qhull compilation on mac

Fix qhull compilation on mac


# FindCMocka
# ----------
# Tries to find CMocka
#
# Variables:
#  CMOCKA_ROOT_DIR - Set this variable to the root installation of CMocka
#
# Read-Only variables:
#  CMOCKA_FOUND - system has CMocka
#  CMOCKA_INCLUDE_DIR - the CMocka include directory
#  CMOCKA_LIBRARIES - Link these to use CMocka
#  CMOCKA_DEFINITIONS - Compiler switches required for using CMocka
#

include(FindPackageHandleStandardArgs)

set(CMOCKA_ROOT_DIR ${CMOCKA_ROOT_DIR} CACHE PATH "Root installation directory of CMocka")

find_path(CMOCKA_INCLUDE_DIR
  NAMES cmocka.h
  PATHS ${CMOCKA_ROOT_DIR}/include
)

find_library(CMOCKA_LIBRARY
  NAMES cmocka
  PATHS ${CMOCKA_ROOT_DIR}/include
)

if(CMOCKA_LIBRARY)
  set(CMOCKA_LIBRARIES
    ${CMOCKA_LIBRARIES}
    ${CMOCKA_LIBRARY}
  )
endif(CMOCKA_LIBRARY)

find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR)

mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARY)

# FindCMocka
# ----------
# Tries to find CMocka
#
# Variables:
#  CMOCKA_ROOT_DIR - Set this variable to the root installation of CMocka
#
# Read-Only variables:
#  CMOCKA_FOUND - system has CMocka
#  CMOCKA_INCLUDE_DIR - the CMocka include directory
#  CMOCKA_LIBRARIES - Link these to use CMocka
#  CMOCKA_DEFINITIONS - Compiler switches required for using CMocka
#

include(FindPackageHandleStandardArgs)

set(CMOCKA_ROOT_DIR ${CMOCKA_ROOT_DIR} CACHE PATH "Root installation directory of CMocka")

find_path(CMOCKA_INCLUDE_DIR
  NAMES cmocka.h
  PATHS ${CMOCKA_ROOT_DIR}/include
)

find_library(CMOCKA_LIBRARY
  NAMES cmocka
  PATHS ${CMOCKA_ROOT_DIR}/lib
)

if(CMOCKA_LIBRARY)
  set(CMOCKA_LIBRARIES
    ${CMOCKA_LIBRARIES}
    ${CMOCKA_LIBRARY}
  )
endif(CMOCKA_LIBRARY)

find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR)

mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARY)

Change path suffix for CMOCKA_LIBRARY

Change path suffix for CMOCKA_LIBRARY


# Finds the libMesh installation using CMake's PkgConfig
# module and creates a libmesh imported target

if (${CMAKE_VERSION} VERSION_LESS 3.12.0)
    message((FATAL_ERROR "OpenMC builds with libMesh support require CMake version 3.12.0 or greater."))
endif()

include(FindPkgConfig)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${LIBMESH_PC}")
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH True)
pkg_check_modules(LIBMESH REQUIRED libmesh>=1.6.0 IMPORTED_TARGET)

find_path(LIBMESH_PC NAMES libmesh.pc
          HINTS ${LIBMESH_LIBDIR}
          PATHS ENV LD_LIBRARY_PATH
          PATH_SUFFIXES lib/pkgconfig pkgconfig
          NO_DEFAULT_PATH)

# Finds the libMesh installation using CMake's PkgConfig
# module and creates a libmesh imported target

if (${CMAKE_VERSION} VERSION_LESS 3.12.0)
    message(FATAL_ERROR "OpenMC builds with libMesh support require CMake version 3.12.0 or greater.")
endif()

include(FindPkgConfig)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${LIBMESH_PC}")
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH True)
pkg_check_modules(LIBMESH REQUIRED libmesh>=1.6.0 IMPORTED_TARGET)

find_path(LIBMESH_PC NAMES libmesh.pc
          HINTS ${LIBMESH_LIBDIR}
          PATHS ENV LD_LIBRARY_PATH
          PATH_SUFFIXES lib/pkgconfig pkgconfig
          NO_DEFAULT_PATH)

Fix for CMake message syntax.

Fix for CMake message syntax.


include (CheckSymbolExists)
include (CMakePushCheckState)

# ~~~
# Check if a symbol is exported
#
# Same as check_symbol_exists but works around the problem of not detecting
# symbols when -Wpedantic is on.
#
# Also automatically adds the definitions of the current directory to
# CMAKE_REQUIRED_DEFINITIONS.
#
# https://issues.libelektra.org/2218
# ~~~

macro (safe_check_symbol_exists SYMBOL FILES VARIABLE)
	set (CMAKE_C_FLAGS_OLD ${CMAKE_C_FLAGS})
	string (REPLACE "-Wpedantic"
			""
			CMAKE_C_FLAGS
			${CMAKE_C_FLAGS})

	cmake_push_check_state ()
	get_directory_property (DEFS COMPILE_DEFINITIONS)
	prepend (DEFS "-D" ${DEFS})
	list (APPEND CMAKE_REQUIRED_DEFINITIONS
		     ${DEFS})

	cmake_pop_check_state ()
	check_symbol_exists ("${SYMBOL}" "${FILES}" "${VARIABLE}")

	set (CMAKE_C_FLAGS ${CMAKE_C_FLAGS_OLD})
endmacro ()

# Prepends prefix onto all argn list members and saves the result to var Can be replaced by list(TRANSFORM .. PREPEND ..) once we use CMake
# 3.12
function (prepend var prefix)
	set (temp "")
	foreach (f ${ARGN})
		list (APPEND temp
			     "${prefix}${f}")
	endforeach (f)
	set (${var} "${temp}" PARENT_SCOPE)
endfunction (prepend)

include (CheckSymbolExists)
include (CMakePushCheckState)

# ~~~
# Check if a symbol is exported
#
# Same as check_symbol_exists but works around the problem of not detecting
# symbols when -Wpedantic is on.
#
# Also automatically adds the definitions of the current directory to
# CMAKE_REQUIRED_DEFINITIONS.
#
# https://issues.libelektra.org/2218
# ~~~

macro (safe_check_symbol_exists SYMBOL FILES VARIABLE)
	set (CMAKE_C_FLAGS_OLD ${CMAKE_C_FLAGS})
	string (REPLACE "-Wpedantic"
			""
			CMAKE_C_FLAGS
			${CMAKE_C_FLAGS})

	cmake_push_check_state ()
	get_directory_property (DEFS COMPILE_DEFINITIONS)
	prepend (DEFS "-D" ${DEFS})
	list (APPEND CMAKE_REQUIRED_DEFINITIONS
		     ${DEFS})

	check_symbol_exists ("${SYMBOL}" "${FILES}" "${VARIABLE}")
	cmake_pop_check_state ()
	set (CMAKE_C_FLAGS ${CMAKE_C_FLAGS_OLD})
endmacro ()

# Prepends prefix onto all argn list members and saves the result to var Can be replaced by list(TRANSFORM .. PREPEND ..) once we use CMake
# 3.12
function (prepend var prefix)
	set (temp "")
	foreach (f ${ARGN})
		list (APPEND temp
			     "${prefix}${f}")
	endforeach (f)
	set (${var} "${temp}" PARENT_SCOPE)
endfunction (prepend)

Move cmake pop check state to correct place


#!
#! \brief Add a custom test for MITK module
#!
#! \param test_name Unique identifier for the test
#! \param test_function Name of the test function (the one with the argc,argv signature)
#!
#! Additional parameters will be passed as command line parameters to the test.
#!
function(mitkAddCustomModuleTest test_name test_function)
  add_test(${test_name} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${test_function} ${ARGN})
  set_property(TEST ${test_name} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
endfunction()

#!
#! \brief Add a custom test for MITK module
#!
#! \param test_name Unique identifier for the test
#! \param test_function Name of the test function (the one with the argc,argv signature)
#!
#! Additional parameters will be passed as command line parameters to the test.
#!
function(mitkAddCustomModuleTest test_name test_function)

  if (BUILD_TESTING AND NOT ${MODULE_NAME}_IS_ENABLED)
    add_test(${test_name} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${test_function} ${ARGN})
    set_property(TEST ${test_name} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
  endif()

endfunction()

Make macro safe for "selected modules only" build

mb:d1cd88a6-7434-4b95-ad3f-b3b52546dea2.


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

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

# "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 "bf00dcbe8bfcdb9d6ce1c029f3e125785827a93f")

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

Update FW with latest apriltag

Update FW with latest apriltag


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

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

# "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 "db62f875ea8aca53e22b4095daff67a26e1cfdd2")

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

Update FW with runtime disparity range fix


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

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

# "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 "53c09072ddcc23361a37026486e668196695a790")

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

Update FW - [ImageManip] Adding support for input/output GRAY8 format


set(DOCUMENTATION "This module contains classes for reading and writing image
files in the MINC 2 file Format (mnc) and transformations (xfm).")

itk_module(ITKIOMINC
  ENABLE_SHARED
  DEPENDS
    ITKIOImageBase
  PRIVATE_DEPENDS
    ITKMINC
  TEST_DEPENDS
    ITKTestKernel
    ITKMINC
    ITKImageStatistics
  DESCRIPTION
    "${DOCUMENTATION}"
  EXCLUDE_FROM_DEFAULT
)

set(DOCUMENTATION "This module contains classes for reading and writing image
files in the MINC 2 file Format (mnc) and transformations (xfm).")

itk_module(ITKIOMINC
  ENABLE_SHARED
  DEPENDS
    ITKIOImageBase
  PRIVATE_DEPENDS
    ITKMINC
  TEST_DEPENDS
    ITKTestKernel
    ITKMINC
    ITKImageStatistics
  DESCRIPTION
    "${DOCUMENTATION}"
)

Enable MINC IO by default

ENH: Enable MINC IO by default

Recent runs of valgrind with MINC showed no defects.

Change-Id: Iae2d73207af66eea482dedd0161136736e53224d


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

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

# "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 "32581ad0d1d86e743d011ef747d57a3f39bbc6d9")

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

Update FW: StereoDepth: fix RGB alignment when running at calib resolution (OAK-D with 800_P or OAK-D-Lite)


set(DOCUMENTATION "This module contains classes for deformable image
registration based on intensity differences by solving the PDE, optical flow
problem.  This includes Thirion's popular \"demons\" algorithm.")

itk_module(ITKPDEDeformableRegistration
  DEPENDS
    ITKRegistrationCommon
    ITKFiniteDifference
  TEST_DEPENDS
    ITKTestKernel
  DESCRIPTION
    "${DOCUMENTATION}"
)

set(DOCUMENTATION "This module contains classes for deformable image
registration based on intensity differences by solving the PDE, optical flow
problem.  This includes Thirion's popular \"demons\" algorithm.")

set(_FFTW_DEPENDS )
if( ITK_USE_FFTWF OR ITK_USE_FFTWD )
  set(_FFTW_DEPENDS "ITKFFT")
endif()

itk_module(ITKPDEDeformableRegistration
  DEPENDS
    ${_FFTW_DEPENDS}
    ITKRegistrationCommon
    ITKFiniteDifference
  TEST_DEPENDS
    ITKTestKernel
  DESCRIPTION
    "${DOCUMENTATION}"
)

COMP: Address missing fftw include in CurvatureRegistrationFilter

When FFTW is enable the CurvatureRegistrationFilter is dependent upon
the ITKFFTW module.


# This file is distributed under the MIT license.
# See the LICENSE file for details.

#---------------------------------------------------------------------------------------------------
# Module to handle VSNRAY_* options
#

if(MSVC)

else() # GNU, Clang, etc.

    #------------------------------------------------------
    # Enable warnings
    #

    add_definitions(-Wmissing-braces)
    add_definitions(-Wsign-compare)
    add_definitions(-Wwrite-strings)
    add_definitions(-Woverloaded-virtual)

    if(VSNRAY_ENABLE_WARNINGS)
        add_definitions(-Wall -Wextra)

        if(VSNRAY_ENABLE_PEDANTIC)
            add_definitions(-pedantic)
        endif()
    endif()

    #------------------------------------------------------
    # Selectively disable warnings
    #

    if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
        if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
            # Disable warnings like:
            # warning: ignoring attributes on template argument __m128i
            add_definitions(-Wno-ignored-attributes)
        endif()
    endif()
endif()

# This file is distributed under the MIT license.
# See the LICENSE file for details.

#---------------------------------------------------------------------------------------------------
# Module to handle VSNRAY_* options
#

if(MSVC)

else() # GNU, Clang, etc.

    #------------------------------------------------------
    # Enable warnings
    #

    add_definitions(-Wmissing-braces)
    add_definitions(-Wsign-compare)
    add_definitions(-Wwrite-strings)
    add_definitions(-Woverloaded-virtual)
    add_definitions(-Wundef)

    if(VSNRAY_ENABLE_WARNINGS)
        add_definitions(-Wall -Wextra)

        if(VSNRAY_ENABLE_PEDANTIC)
            add_definitions(-pedantic)
        endif()
    endif()

    #------------------------------------------------------
    # Selectively disable warnings
    #

    if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
        if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
            # Disable warnings like:
            # warning: ignoring attributes on template argument __m128i
            add_definitions(-Wno-ignored-attributes)
        endif()
    endif()
endif()

Add -Wundef to default warning set

Add -Wundef to default warning set


if(MATIO_WITH_HDF5)
    find_package(HDF5 1.8)
    if(HDF5_FOUND)
        set(HAVE_HDF5 1)
    endif()
endif()

if(MATIO_WITH_ZLIB)
    find_package(ZLIB 1.2.3)
    if(ZLIB_FOUND)
        set(HAVE_ZLIB 1)
    endif()
endif()

if(HDF5_FOUND)
    add_library(HDF5::HDF5 INTERFACE IMPORTED)
    set_target_properties(HDF5::HDF5 PROPERTIES
        INTERFACE_INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIRS}"
        INTERFACE_LINK_LIBRARIES "${HDF5_LIBRARIES}"
    )
endif()

if(NOT HAVE_HDF5 AND MATIO_MAT73)
    message(FATAL_ERROR "MAT73 requires HDF5")
endif()

if(MATIO_WITH_HDF5)
    find_package(HDF5)
    if(HDF5_FOUND)
        if(HDF5_VERSION VERSION_LESS 1.8)
            message(FATAL_ERROR "HDF5 version ${HDF5_VERSION} is unsupported, minimum of 1.8 is required")
        endif()
        set(HAVE_HDF5 1)
    endif()
endif()

if(MATIO_WITH_ZLIB)
    find_package(ZLIB 1.2.3)
    if(ZLIB_FOUND)
        set(HAVE_ZLIB 1)
    endif()
endif()

if(HDF5_FOUND)
    add_library(HDF5::HDF5 INTERFACE IMPORTED)
    if(HDF5_USE_STATIC_LIBRARIES AND TARGET hdf5::hdf5-static)
        # static target from hdf5 1.10 or 1.12 config
        target_link_libraries(HDF5::HDF5 INTERFACE hdf5::hdf5-static)
    elseif(NOT HDF5_USE_STATIC_LIBRARIES AND TARGET hdf5::hdf5-shared)
        # shared target from hdf5 1.10 or 1.12 config
        target_link_libraries(HDF5::HDF5 INTERFACE hdf5::hdf5-shared)
    elseif(TARGET hdf5)
        # target from hdf5 1.8 config
        target_link_libraries(HDF5::HDF5 INTERFACE hdf5)
        if(NOT HDF5_USE_STATIC_LIBRARIES)
            target_compile_definitions(HDF5::HDF5 INTERFACE "H5_BUILT_AS_DYNAMIC_LIB")
        endif()
    else()
        # results from CMake FindHDF5
        target_include_directories(HDF5::HDF5 INTERFACE "${HDF5_INCLUDE_DIRS}")
        target_link_libraries(HDF5::HDF5 INTERFACE "${HDF5_LIBRARIES}")
        target_compile_definitions(HDF5::HDF5 INTERFACE "${HDF5_DEFINITIONS}")
    endif()
endif()

if(NOT HAVE_HDF5 AND MATIO_MAT73)
    message(FATAL_ERROR "MAT73 requires HDF5")
endif()

Fix using hdf5-config from HDF5

Fix using hdf5-config from HDF5

The config files require an exact version match. Also use the provided targets directly.
Define H5_BUILT_AS_DYNAMIC_LIB when HDF5 1.8 config file is used.


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

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

# "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 "e89359595f669e066ac690799f4fb20f6af16754")

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

Update FW with multiple fixes: - properly handle manual/auto focus with multiple cameras - fix potential init failure with same sensors (IMX378/477/214 / AR0234 / OV5645) on Left and Right sockets - fix sensor name reporting for AR0234 / IMX378/380/477/577


# Always include srcdir and builddir in include path
# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in
# about every subdir
# since cmake 2.4.0
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Put the include dirs which are in the source or build tree
# before all other include dirs, so the headers in the sources
# are prefered over the already installed ones
# since cmake 2.4.1
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)

# Use colored output
# since cmake 2.4.0
set(CMAKE_COLOR_MAKEFILE ON)

# Define the generic version of the libraries here
set(GENERIC_LIB_VERSION "0.1.0")
set(GENERIC_LIB_SOVERSION "0")

# Set the default build type to release with debug info
if (NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE RelWithDebInfo
    CACHE STRING
      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
  )
endif (NOT CMAKE_BUILD_TYPE)

# Create the compile command database for clang by default
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

cmake: Enable creation of the compile command database by default.

(cherry picked from commit 437a39c7988ae157e2171f57d8c0cfdcc99584f6)


SET(LIB_REQUIRED_DEP_PACKAGES
  DataTransferKitNanoflann
  DataTransferKitUtils
  Teuchos
  Tpetra
  AztecOO
  Belos
  ThyraCore
  ThyraTpetraWrappers
  Stratimikos
 )

SET(LIB_OPTIONAL_DEP_PACKAGES)

SET(TEST_REQUIRED_DEP_PACKAGES
  DataTransferKitBasicGeometryAdapters
)

SET(TEST_OPTIONAL_DEP_PACKAGES)

SET(LIB_REQUIRED_DEP_TPLS)

SET(LIB_OPTIONAL_DEP_TPLS)

SET(TEST_REQUIRED_DEP_TPLS)

SET(TEST_OPTIONAL_DEP_TPLS)

SET(LIB_REQUIRED_DEP_PACKAGES
  DataTransferKitNanoflann
  DataTransferKitUtils
  Teuchos
  Tpetra
  AztecOO
  Belos
  ThyraCore
  ThyraTpetraAdapters
  Stratimikos
 )

SET(LIB_OPTIONAL_DEP_PACKAGES)

SET(TEST_REQUIRED_DEP_PACKAGES
  DataTransferKitBasicGeometryAdapters
)

SET(TEST_OPTIONAL_DEP_PACKAGES)

SET(LIB_REQUIRED_DEP_TPLS)

SET(LIB_OPTIONAL_DEP_TPLS)

SET(TEST_REQUIRED_DEP_TPLS)

SET(TEST_OPTIONAL_DEP_TPLS)

Change invalid ThyraTpetraWrappers with ThyraTpetraAdapters

I am not sure how this was able to configure in other contexts.


# Set the test name, 'test_' will be prepended to the
# name set here
set(CURRENT_TEST parser)
# Set a category name to enable running commands like:
#    ctest -R <category-label>
# which will run the tests matching this category-label.
# Can be left empty (or just not set)
set(${CURRENT_TEST}_CATEGORY misc)
list(APPEND LIBCELLML_TESTS ${CURRENT_TEST})
# Using absolute path relative to this file
set(${CURRENT_TEST}_SRCS
  ${CMAKE_CURRENT_LIST_DIR}/parser.cpp
  ${CMAKE_CURRENT_LIST_DIR}/file-parser.cpp
)
#set(${CURRENT_TEST}_HDRS
#  ${CMAKE_CURRENT_LIST_DIR}/<test_header_files.h>
#)

set(CELLML_SINE_MODEL_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/sine_approximations.xml")
set(CELLML_SINE_IMPORTS_MODEL_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/sine_approximations_import.xml")
set(CELLML_ORD_MODEL_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/Ohara_Rudy_2011.cellml")
set(CELLML_INVALID_MODEL_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/invalid_cellml_2.0.xml")

# Set the test name, 'test_' will be prepended to the
# name set here
set(CURRENT_TEST parser)
# Set a category name to enable running commands like:
#    ctest -R <category-label>
# which will run the tests matching this category-label.
# Can be left empty (or just not set)
set(${CURRENT_TEST}_CATEGORY misc)
list(APPEND LIBCELLML_TESTS ${CURRENT_TEST})
# Using absolute path relative to this file
set(${CURRENT_TEST}_SRCS
  ${CMAKE_CURRENT_LIST_DIR}/parser.cpp
  ${CMAKE_CURRENT_LIST_DIR}/file_parser.cpp
)
#set(${CURRENT_TEST}_HDRS
#  ${CMAKE_CURRENT_LIST_DIR}/<test_header_files.h>
#)

set(CELLML_SINE_MODEL_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/sine_approximations.xml")
set(CELLML_SINE_IMPORTS_MODEL_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/sine_approximations_import.xml")
set(CELLML_ORD_MODEL_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/Ohara_Rudy_2011.cellml")
set(CELLML_INVALID_MODEL_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/invalid_cellml_2.0.xml")

Change filename in CMakeLists.txt file to match previous commits changes.


cmake_minimum_required(VERSION 2.8)

option (BUILD_ALLEGRO_SOUNDBACKEND "Build an allegro audio backend" ON)

set (SOUNDBACKENDS "")
set (SOUNDBACKEND_SOURCES "")
set (SOUNDBACKEND_LIBRARIES "")
set (SOUNDBACKEND_INCLUDES "")

if(BUILD_ALLEGRO_SOUNDBACKEND)
		list(APPEND SOUNDBACKENDS allegro)
		list(APPEND SOUNDBACKEND_SOURCES "framework/sound/allegro_backend.cpp")
		list(APPEND FRAMEWORK_ALLEGRO_LIBRARIES allegro_audio)
endif()

if (NOT SOUNDBACKENDS)
		message(FATAL_ERROR "No sound backends specified")
endif()

message("Building sound backends: ${SOUNDBACKENDS}")

cmake_minimum_required(VERSION 2.8)

option (BUILD_ALLEGRO_SOUNDBACKEND "Build an allegro audio backend" ON)
option (BUILD_NULL_SOUNDBACKEND "Build an null (non-functional) audio backend" ON)

set (SOUNDBACKENDS "")
set (SOUNDBACKEND_SOURCES "")
set (SOUNDBACKEND_LIBRARIES "")
set (SOUNDBACKEND_INCLUDES "")

if(BUILD_ALLEGRO_SOUNDBACKEND)
		list(APPEND SOUNDBACKENDS allegro)
		list(APPEND SOUNDBACKEND_SOURCES "framework/sound/allegro_backend.cpp")
		list(APPEND FRAMEWORK_ALLEGRO_LIBRARIES allegro_audio)
endif()

if(BUILD_NULL_SOUNDBACKEND)
		list(APPEND SOUNDBACKENDS null)
		list(APPEND SOUNDBACKEND_SOURCES "framework/sound/null_backend.cpp")
endif()

if (NOT SOUNDBACKENDS)
		message(FATAL_ERROR "No sound backends specified")
endif()

message("Building sound backends: ${SOUNDBACKENDS}")

Add null sound backend to cmake

Add null sound backend to cmake


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

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

# "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 "75abb68c69b4f4168646eb50e311983f57ff9281")

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

Update FW internal commit hash

Update FW internal commit hash


itk_fetch_module(SCIFIO
  "SCIFIO (Bioformats) ImageIO plugin for ITK"
  GIT_REPOSITORY ${git_protocol}://github.com/scifio/scifio-imageio.git
  GIT_TAG d6ce39d855d5078589efed93f785c7289769c3c6
  )

itk_fetch_module(SCIFIO
  "SCIFIO (Bioformats) ImageIO plugin for ITK"
  GIT_REPOSITORY ${git_protocol}://github.com/scifio/scifio-imageio.git
  GIT_TAG eb391a74e77b161e0f070539237193528c628f7b
  )

ENH: Update SCIFIO to latest version on 08/29/2016

https://github.com/scifio/scifio-imageio/compare/d6ce39d855d5078589efed93f785c7289769c3c6...eb391a74e77b161e0f070539237193528c628f7b

Change-Id: If7a96c28eca18ff6164795145cb80500b7b115f6


add_custom_command(
  OUTPUT ${CMAKE_SOURCE_DIR}/test/node_modules
  DEPENDS ${CMAKE_SOURCE_DIR}/test/package.json
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test
  COMMAND npm install
  COMMAND npm prune
)

add_custom_target(
  test-proxy-target
  COMMAND npm test
  DEPENDS ${CMAKE_SOURCE_DIR}/test/node_modules
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test
)

add_custom_target(
  test-proxy
  COMMAND ${CMAKE_BUILD_TOOL} all
  COMMAND ${CMAKE_BUILD_TOOL} test-proxy-target
)

add_custom_command(
  OUTPUT ${CMAKE_SOURCE_DIR}/test/node_modules/.bin/grunt
  DEPENDS ${CMAKE_SOURCE_DIR}/test/package.json
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test
  COMMAND npm install
  COMMAND npm prune
)

add_custom_target(
  test-proxy-target
  COMMAND npm test
  DEPENDS ${CMAKE_SOURCE_DIR}/test/node_modules/.bin/grunt
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test
)

add_custom_target(
  test-proxy
  COMMAND ${CMAKE_BUILD_TOOL} all
  COMMAND ${CMAKE_BUILD_TOOL} test-proxy-target
)

Fix test building if node_modules directory exists, but is empty.


include(velodyneviewer.bundle.common)

set (CPACK_GENERATOR DragNDrop)
include(CPack)

# we only to paraview explicitly.
install(CODE "
     file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}\" USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
          \"${install_location}/bin/VeloView.app\")

     file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}\" USE_SOURCE_PERMISSIONS TYPE FILE FILES
          \"${SuperBuild_BINARY_DIR}/velodyneviewer/src/velodyneviewer/Doc/VeloView_Developer_Guide.pdf\")

     file(WRITE \"\${CMAKE_INSTALL_PREFIX}/VeloView.app/Contents/Resources/qt.conf\"
                \"\")
     execute_process(
       COMMAND ${CMAKE_CURRENT_LIST_DIR}/fixup_bundle.py
               \"\${CMAKE_INSTALL_PREFIX}/VeloView.app\"
               \"${install_location}/lib\"
               \"${SuperBuild_BINARY_DIR}/paraview/src/paraview-build/lib\"
               \"${install_location}/plugins\")
   "
   COMPONENT superbuild)

include(velodyneviewer.bundle.common)

set (CPACK_GENERATOR DragNDrop)
include(CPack)

install(CODE "
     file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}\" USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
          \"${install_location}/bin/VeloView.app\")

     file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}\" USE_SOURCE_PERMISSIONS TYPE FILE FILES
          \"${VelodyneViewerSuperBuild_SOURCE_DIR}/../Documentation/VeloView_Developer_Guide.pdf\")

     file(WRITE \"\${CMAKE_INSTALL_PREFIX}/VeloView.app/Contents/Resources/qt.conf\"
                \"\")
     execute_process(
       COMMAND ${CMAKE_CURRENT_LIST_DIR}/fixup_bundle.py
               \"\${CMAKE_INSTALL_PREFIX}/VeloView.app\"
               \"${install_location}/lib\"
               \"${SuperBuild_BINARY_DIR}/paraview/src/paraview-build/lib\"
               \"${install_location}/plugins\")
   "
   COMPONENT superbuild)

Fix path to documentation pdf.

Fix path to documentation pdf.


#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you 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.
#

#
# Check qpid-proton.dll after linking for dangerous calls to
# Windows functions that suggest but deviate from C99 behavior:
#   _snprintf, vsnprintf, _vsnprintf
# See platform.h for safe wrapper calls.
#

set(obj_dir ${CMAKE_CURRENT_BINARY_DIR}/qpid-proton.dir/${CMAKE_CFG_INTDIR})

add_custom_command(TARGET qpid-proton PRE_LINK COMMAND ${PYTHON_EXECUTABLE}
        ${CMAKE_MODULE_PATH}WindowsC99SymbolCheck.py ${obj_dir}
        COMMENT "Checking for dangerous use of C99-violating functions")

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you 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.
#

#
# Check qpid-proton.dll after linking for dangerous calls to
# Windows functions that suggest but deviate from C99 behavior:
#   _snprintf, vsnprintf, _vsnprintf
# See platform.h for safe wrapper calls.
#

set(obj_dir ${CMAKE_CURRENT_BINARY_DIR}/qpid-proton.dir/${CMAKE_CFG_INTDIR})

add_custom_command(
    TARGET qpid-proton
	PRE_LINK
    COMMAND ${PYTHON_EXECUTABLE}
	    ${CMAKE_MODULE_PATH}WindowsC99SymbolCheck.py $<TARGET_FILE_DIR:qpid-proton>
    COMMENT "Checking for dangerous use of C99-violating functions")

NO-JIRA: Make windows check symbols work more reliably


cmake_minimum_required(VERSION 2.8.6)

function(add_plugin name)
  add_library(${name} MODULE ${ARGN})

  set_target_properties(${name} PROPERTIES PREFIX "")

  if(CMAKE_COMPILER_IS_GNUCC)
    set_property(TARGET ${name} APPEND_STRING PROPERTY COMPILE_FLAGS " -m32")
    set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS    " -m32")
  endif()

  if(WIN32 AND CMAKE_COMPILER_IS_GNUCC)
    set_property(TARGET ${name} APPEND_STRING PROPERTY
                 LINK_FLAGS " -Wl,--enable-stdcall-fixup")
  endif()

  if(UNIX AND NOT WIN32)
    set_property(TARGET ${name} APPEND PROPERTY COMPILE_DEFINITIONS "LINUX")
  endif()
endfunction()

Remove pointless cmake_minimum_required(VERSION ...) statement


# Copyright (c) 2012 Stefan Eilemann <eile@eyescale.ch>
# gathers LSB system information

if(LSB_RELEASE)
  return()
endif()

find_program(LSB_RELEASE_EXECUTABLE lsb_release)

if(LSB_RELEASE_EXECUTABLE)
  execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sr
    OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)

  execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -si
    OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
  set(LSB_DISTRIBUTOR_ID "unknown")
  set(LSB_RELEASE "unknown")
endif()

# Copyright (c) 2012 Stefan Eilemann <eile@eyescale.ch>
# gathers LSB system information

if(LSB_RELEASE)
  return()
endif()

find_program(LSB_RELEASE_EXECUTABLE lsb_release)

if(LSB_RELEASE_EXECUTABLE)
  execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sc
    OUTPUT_VARIABLE LSB_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE)

  execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sr
    OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)

  execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -si
    OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
  set(LSB_DISTRIBUTOR_ID "unknown")
  set(LSB_RELEASE "unknown")
  set(LSB_CODENAME "unknown")
endif()

Bring LSB_CODENAME back, needed for Fivox w/ broken ITK on Ubuntu trusty


#
# Find the native FREETYPE includes and library
#

# This module defines
# FREETYPE_INCLUDE_DIR, where to find ft2build.h, ftheader.h, ...
# FREETYPE_LIBRARIES, the libraries to link against to use FREETYPE.
# FREETYPE_FOUND, If false, do not try to use FREETYPE.

# also defined, but not for general use are
# FREETYPE_LIBRARY, where to find the FREETYPE library.

FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h
  /usr/include/
  /usr/local/include/
)

FIND_PATH(FREETYPE_INCLUDE_DIR_FTHEADER freetype/config/ftheader.h
  /usr/include/freetype2
  /usr/local/include/freetype2
)

FIND_LIBRARY(FREETYPE_LIBRARY freetype
  /usr/lib
  /usr/local/lib
)

IF (FREETYPE_LIBRARY)
  IF (FREETYPE_INCLUDE_DIR_FTHEADER AND FREETYPE_INCLUDE_DIR_FT2BUILD)
    SET( FREETYPE_FOUND "YES" )
    SET( FREETYPE_INCLUDE_DIR
      ${FREETYPE_INCLUDE_DIR_FT2BUILD}
      ${FREETYPE_INCLUDE_DIR_FTHEADER} )
    SET( FREETYPE_LIBRARIES ${FREETYPE_LIBRARY} )
  ENDIF (FREETYPE_INCLUDE_DIR_FTHEADER AND FREETYPE_INCLUDE_DIR_FT2BUILD)
ENDIF (FREETYPE_LIBRARY)

#
# Find the native FREETYPE includes and library
#
# Just use the FindFreetype function available in recent cmake versions.

INCLUDE(FindFreetype)

Fix freetype detection on Ubuntu 14.04

Fix freetype detection on Ubuntu 14.04

We now just use the FindFreetype-function that has been available in cmake
for years (at least since 2008).


macro(package_add_test TESTNAME)
    add_executable(${TESTNAME}.x EXCLUDE_FROM_ALL ${ARGN})
    target_compile_options(${TESTNAME}.x PRIVATE -Wunused-parameter -Wall)
    target_link_libraries(${TESTNAME}.x JPetFramework::JPetFramework Boost::unit_test_framework)
    add_test(NAME ${TESTNAME}.x COMMAND ${TESTNAME}.x "--log_level=ERROR --log_format=XML --log_sink=${TESTNAME}.xml --raport_level=no")
    set_target_properties(${TESTNAME}.x PROPERTIES FOLDER tests)
    add_dependencies(${TESTNAME}.x link_target)
endmacro()

function(package_add_format_hook)
  set(INSTALL_HOOK ${CMAKE_CURRENT_SOURCE_DIR}/hooks/git-pre-commit-format install)
  execute_process(COMMAND ${INSTALL_HOOK})
endfunction()

macro(package_add_test TESTNAME)
    add_executable(${TESTNAME}.x EXCLUDE_FROM_ALL ${ARGN})
    target_compile_options(${TESTNAME}.x PRIVATE -Wunused-parameter -Wall)
    target_link_libraries(${TESTNAME}.x JPetFramework::JPetFramework Boost::unit_test_framework)
    add_test(NAME ${TESTNAME}.x COMMAND ${TESTNAME}.x --log_level=error --log_format=XML --log_sink=${TESTNAME}.xml)
    set_target_properties(${TESTNAME}.x PROPERTIES FOLDER tests)
    add_dependencies(${TESTNAME}.x link_target)
endmacro()

function(package_add_format_hook)
  set(INSTALL_HOOK ${CMAKE_CURRENT_SOURCE_DIR}/hooks/git-pre-commit-format install)
  execute_process(COMMAND ${INSTALL_HOOK})
endfunction()

Fix running tests for certain boost versions


find_path(POSTGRES_INCLUDE_DIR postgres.h
          /usr/include/postgresql
          /usr/local/include/postgresql
)

find_library(POSTGRES_LIBRARY
             NAMES pq libpq
             PATH /usr/lib      /usr/local/lib
                  /usr/lib64    /usr/local/lib64
)

if(POSTGRES_INCLUDE_DIR AND POSTGRES_LIBRARY)
    set(POSTGRES_FOUND TRUE)
endif()

if(POSTGRES_FOUND)
    if(NOT Postgres_FIND_QUIETLY)
        message(STATUS "Found PosgreSQL: ${POSTGRES_LIBRARY}")
    endif()
else()
   if(Postgres_FIND_REQUIRED)
        message(FATAL_ERROR "Could not find PostgreSQL")
   endif()
endif()

find_path(POSTGRES_INCLUDE_DIR postgres.h
          /usr/include/postgresql
          /usr/include/postgresql/server
          /usr/local/include/postgresql
          /usr/local/include/postgresql/server
)

find_library(POSTGRES_LIBRARY
             NAMES pq libpq
             PATH /usr/lib      /usr/local/lib
                  /usr/lib64    /usr/local/lib64
)

if(POSTGRES_INCLUDE_DIR AND POSTGRES_LIBRARY)
    set(POSTGRES_FOUND TRUE)
endif()

if(POSTGRES_FOUND)
    if(NOT Postgres_FIND_QUIETLY)
        message(STATUS "Found PosgreSQL: ${POSTGRES_LIBRARY}")
    endif()
else()
   if(Postgres_FIND_REQUIRED)
        message(FATAL_ERROR "Could not find PostgreSQL")
   endif()
endif()

Add more search paths for PSQL. Fixes build on Gentoo


# Find and set Boost flags

if(NOT PCL_SHARED_LIBS)
    set(Boost_USE_STATIC_LIBS ON)
endif(NOT PCL_SHARED_LIBS)

find_package(Boost 1.36.0 COMPONENTS system filesystem thread)
# TODO: What should the minimum version number be?
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

# Find and set Boost flags

if(NOT PCL_SHARED_LIBS)
    set(Boost_USE_STATIC_LIBS ON)
endif(NOT PCL_SHARED_LIBS)

find_package(Boost 1.44.0 COMPONENTS system filesystem thread)
# TODO: What should the minimum version number be?
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

Fix: Boost filesystem v3 are supported starting 1.44 only

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@161 a9d63959-f2ad-4865-b262-bf0e56cfafb6


#
# Copyright 2018 Jeff Bush
#
# 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.
#

macro(add_command_line_tool name)
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-O3")
    set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-O3")
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
    add_executable(${name} ${ARGN})
endmacro()

#
# Copyright 2018 Jeff Bush
#
# 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.
#

macro(add_command_line_tool name)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
    add_executable(${name} ${ARGN})
endmacro()

Fix minor issue in command line tool cmake module

Would cause error when appending to cflags in a project specific CMakeLists.txt


# Toolchain file for building 32-bit Linux libraries

set(CMAKE_C_FLAGS -m32)
set(CMAKE_CXX_FLAGS -m32)
set(CMAKE_LIBRARY_PATH "/usr/lib/i386-linux-gnu")

# Toolchain file for building 32-bit Linux libraries

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
set(CMAKE_LIBRARY_PATH "/usr/lib/i386-linux-gnu")

Fix the Linux 32-bit toolchain to append to the flags, not override

PiperOrigin-RevId: 291808636


vtk_module(vtkRenderingMatplotlib
  IMPLEMENTS
    vtkRenderingMathText
  DEPENDS
    vtkRenderingCore
    vtkWrappingPython
  TEST_DEPENDS
    vtkInteractionImage
    vtkInteractionWidgets
    vtkIOExport
    vtkTestingRendering
    vtkRenderingGL2PS
    vtkRenderingOpenGL
    vtkRenderingFreeTypeOpenGL
    vtkViewsContext2D
  EXCLUDE_FROM_WRAPPING
  )

vtk_module(vtkRenderingMatplotlib
  IMPLEMENTS
    vtkRenderingMathText
  DEPENDS
    vtkRenderingCore
    vtkWrappingPython
  TEST_DEPENDS
    vtkInteractionImage
    vtkInteractionWidgets
    vtkIOExport
    vtkIOGeometry
    vtkTestingRendering
    vtkRenderingGL2PS
    vtkRenderingOpenGL
    vtkRenderingFreeTypeOpenGL
    vtkViewsContext2D
  EXCLUDE_FROM_WRAPPING
  )

Add missing testing dependency for Rendering/Matplotlib.

Change-Id: I01a62e68faa43e35ea5f60cff929d75ed8b2cbe6


#!
#! \brief Add a custom test for MITK module
#!
#! \param test_name Unique identifier for the test
#! \param test_function Name of the test function (the one with the argc,argv signature)
#!
#! Additional parameters will be passed as command line parameters to the test.
#!
function(mitkAddCustomModuleTest test_name test_function)

  if (BUILD_TESTING AND ${MODULE_NAME}_IS_ENABLED OR MODULE_NAME STREQUAL "Mitk")
      add_test(${test_name} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${test_function} ${ARGN})
      set_property(TEST ${test_name} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
  endif()

endfunction()

#!
#! \brief Add a custom test for MITK module
#!
#! \param test_name Unique identifier for the test
#! \param test_function Name of the test function (the one with the argc,argv signature)
#!
#! Additional parameters will be passed as command line parameters to the test.
#!
function(mitkAddCustomModuleTest test_name test_function)

  if (BUILD_TESTING AND MODULE_IS_ENABLED)
    add_test(${test_name} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${test_function} ${ARGN})
    set_property(TEST ${test_name} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
  endif()

endfunction()

Use MODULE_IS_ENABLED to decide whether or not to add a test case


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

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

# "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 "c6f9eda4f47b4aa26538b7e79743d1940db74bb5")

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

Update FW: fix ColorCamera `preview`/`video`/`still` when multiple cameras use these outputs


#
# Find the packages required by this module
#

# Needed VTK version
set(VERSION_MIN "5.10.0")

# Look for VTK
find_package(VTK COMPONENTS
  vtkCommonCore
  vtkRenderingCore
  vtkRenderingOpenGL
  vtkRenderingFreeType
  vtkInteractionStyle
  vtkIOImage
  vtkImagingSources
  REQUIRED)

# Older versions of VTK (VTK 5.5 for example) do not have VTK_VERSION, in this
# case it needs to be defined manually
if(NOT VTK_VERSION)
set(VTK_VERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
endif()

if (${VTK_VERSION} VERSION_LESS ${VERSION_MIN})
  message(ERROR " VtkGlue requires VTK version ${VERSION_MIN} or newer but the current version is ${VTK_VERSION}")
endif()

# The VTK DICOMParser and vtkmetaio includes conflict with the ITK
# versions. Here we remove them from the include directories.
#
string(REGEX REPLACE "[^;]*MetaIO;"
         "" VTK_INCLUDE_DIRS "${VTK_INCLUDE_DIRS}")
string(REGEX REPLACE "[^;]*vtkmetaio;"
         "" VTK_INCLUDE_DIRS "${VTK_INCLUDE_DIRS}")
string(REGEX REPLACE "[^;]*DICOMParser;"
         "" VTK_INCLUDE_DIRS "${VTK_INCLUDE_DIRS}")
include(${VTK_USE_FILE})

#
# Find the packages required by this module
#

# Needed VTK version
set(VERSION_MIN "5.10.0")

set(_wrap_module)
if(ITK_WRAP_PYTHON)
  set(_wrap_module vtkWrappingPythonCore)
endif()
# Look for VTK
find_package(VTK REQUIRED
  COMPONENTS
  vtkCommonCore
  vtkRenderingCore
  vtkRenderingOpenGL
  vtkRenderingFreeType
  vtkInteractionStyle
  vtkIOImage
  vtkImagingSources
  ${_wrap_module}
  )

# Older versions of VTK (VTK 5.5 for example) do not have VTK_VERSION, in this
# case it needs to be defined manually
if(NOT VTK_VERSION)
set(VTK_VERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
endif()

if (${VTK_VERSION} VERSION_LESS ${VERSION_MIN})
  message(ERROR " VtkGlue requires VTK version ${VERSION_MIN} or newer but the current version is ${VTK_VERSION}")
endif()

# The VTK DICOMParser and vtkmetaio includes conflict with the ITK
# versions. Here we remove them from the include directories.
#
string(REGEX REPLACE "[^;]*MetaIO;"
         "" VTK_INCLUDE_DIRS "${VTK_INCLUDE_DIRS}")
string(REGEX REPLACE "[^;]*vtkmetaio;"
         "" VTK_INCLUDE_DIRS "${VTK_INCLUDE_DIRS}")
string(REGEX REPLACE "[^;]*DICOMParser;"
         "" VTK_INCLUDE_DIRS "${VTK_INCLUDE_DIRS}")
include(${VTK_USE_FILE})

COMP: Add VTK Python module when wrapping ITKVtkGlue.

Required for missing vtkPythonUtil.h header.

Change-Id: Ida06b0d4adfa491bf78f4f5508b84a9709e45fb2


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

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

# "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 "d2b298e834f3cf746071059e2c1e1c4d37b724af")

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

Update FW: improve OV9782 color saturation and sharpness


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

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

# "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 "1d9a7ed8c70a2d1d2eba386acdebcbf3ca49de29")

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

Update FW to latest develop

Update FW to latest develop


include(CheckFunctionExists)
include(CheckStructHasMember)
include(CheckCXXSourceCompiles)

check_function_exists(
    stat64
    HAVE_STAT64)

check_function_exists(
    pipe2
    HAVE_PIPE2)

check_function_exists(
    getmntinfo
    HAVE_MNTINFO)

check_function_exists(
    strcpy_s
    HAVE_STRCPY_S)

check_function_exists(
    strlcpy
    HAVE_STRLCPY)

check_struct_has_member(
    "struct stat"
    st_birthtime
    "sys/types.h;sys/stat.h"
    HAVE_STAT_BIRTHTIME)

check_struct_has_member(
    "struct dirent"
    d_namlen
    "dirent.h"
    HAVE_DIRENT_NAME_LEN)

check_struct_has_member(
    "struct statfs"
    f_fstypename
    "sys/mount.h"
    HAVE_STATFS_FSTYPENAME)

check_cxx_source_compiles(
    "
    #include <string.h>
    int main() { char* c = strerror_r(0, 0, 0); }
    "
    HAVE_GNU_STRERROR_R)

configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
    ${CMAKE_CURRENT_BINARY_DIR}/config.h)

include(CheckFunctionExists)
include(CheckStructHasMember)
include(CheckCXXSourceCompiles)

#CMake does not include /usr/local/include into the include search path
#thus add it manually. This is required on FreeBSD.
include_directories(/usr/local/include)

check_function_exists(
    stat64
    HAVE_STAT64)

check_function_exists(
    pipe2
    HAVE_PIPE2)

check_function_exists(
    getmntinfo
    HAVE_MNTINFO)

check_function_exists(
    strcpy_s
    HAVE_STRCPY_S)

check_function_exists(
    strlcpy
    HAVE_STRLCPY)

check_struct_has_member(
    "struct stat"
    st_birthtime
    "sys/types.h;sys/stat.h"
    HAVE_STAT_BIRTHTIME)

check_struct_has_member(
    "struct dirent"
    d_namlen
    "dirent.h"
    HAVE_DIRENT_NAME_LEN)

check_struct_has_member(
    "struct statfs"
    f_fstypename
    "sys/mount.h"
    HAVE_STATFS_FSTYPENAME)

check_cxx_source_compiles(
    "
    #include <string.h>
    int main() { char* c = strerror_r(0, 0, 0); }
    "
    HAVE_GNU_STRERROR_R)

configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
    ${CMAKE_CURRENT_BINARY_DIR}/config.h)

Add /usr/local/include to include path for native shims.

CMake does not add the /usr/local/include to the compiler include search
paths by default. This breaks the build on FreeBSD, where all libraries
are installed in /usr/local instead of /usr. So add /usr/local/include
as include path for all shims.