#
# A common CMake file for consistently initializing and verifying the
# SimpleITK_MAX_DIMENSION CMake variable.
#

set(SimpleITK_MAX_DIMENSION_DEFAULT 4)
# 1900 = VS 14.0 (Visual Studio 2015)
if(MSVC AND MSVC_VERSION VERSION_LESS 1900)
  set( SimpleITK_MAX_DIMENSION_DEFAULT 3 )
endif()

if (DEFINED SimpleITK_4D_Image)
  message(WARNING "SimpleITK variable \"SimpleITK_4D_Image\" is \
                   deprecated set \"SimpleITK_MAX_DIMENSION\" instead." )
  if (NOT SimpleITK_4D_Image)
    set( SimpleITK_MAX_DIMENSION_DEFAULT 3 )
  endif()
endif()

set( "SimpleITK_MAX_DIMENSION" "${SimpleITK_MAX_DIMENSION_DEFAULT}"
  CACHE STRING "Add Image and I/O support up to max dimension (integer)." )
mark_as_advanced( SimpleITK_MAX_DIMENSION )

if (NOT SimpleITK_MAX_DIMENSION MATCHES "^[0-9]+$")
  message(FATAL_ERROR "Expect \"SimpleITK_MAX_DIMENSION\" as an integer but got \"${SimpleITK_MAX_DIMENSION}\".")
elseif ( SimpleITK_MAX_DIMENSIONS LESS 3 )
  message(FATAL_ERROR "The minimum  supported value for \"SimpleITK_MAX_DIMENSION\" is 3.")
endif()

#
# A common CMake file for consistently initializing and verifying the
# SimpleITK_MAX_DIMENSION CMake variable.
#

set(SimpleITK_MAX_DIMENSION_DEFAULT 5)
# 1900 = VS 14.0 (Visual Studio 2015)
if(MSVC AND MSVC_VERSION VERSION_LESS 1900)
  set( SimpleITK_MAX_DIMENSION_DEFAULT 3 )
endif()

if (DEFINED SimpleITK_4D_Image)
  message(WARNING "SimpleITK variable \"SimpleITK_4D_Image\" is \
                   deprecated set \"SimpleITK_MAX_DIMENSION\" instead." )
  if (NOT SimpleITK_4D_Image)
    set( SimpleITK_MAX_DIMENSION_DEFAULT 3 )
  endif()
endif()

set( "SimpleITK_MAX_DIMENSION" "${SimpleITK_MAX_DIMENSION_DEFAULT}"
  CACHE STRING "Add Image and I/O support up to max dimension (integer)." )
mark_as_advanced( SimpleITK_MAX_DIMENSION )

if (NOT SimpleITK_MAX_DIMENSION MATCHES "^[0-9]+$")
  message(FATAL_ERROR "Expect \"SimpleITK_MAX_DIMENSION\" as an integer but got \"${SimpleITK_MAX_DIMENSION}\".")
elseif ( SimpleITK_MAX_DIMENSIONS LESS 3 )
  message(FATAL_ERROR "The minimum  supported value for \"SimpleITK_MAX_DIMENSION\" is 3.")
endif()

Set SimpleITK_MAX_DIMENSION to 5 by default


# Client maintainer: blowekamp@mail.nih.gov
set(CTEST_SITE "appveyor")
set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..)
string(SUBSTRING $ENV{APPVEYOR_REPO_COMMIT} 0 7 commit)

# Extract major/minor/patch  versions

set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}")
if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "")
  set(what "$ENV{APPVEYOR_REPO_BRANCH}")
endif()
set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION})
set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}")
if("${CTEST_CMAKE_GENERATOR}" STREQUAL "")
  set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008")
endif()

set(platform $ENV{PLATFORM})

set(CTEST_BUILD_NAME "$ENV{ITK_MODULE_NAME}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}")

list(APPEND CTEST_NOTES_FILES
  "$ENV{PROJ_SRC}/appveyor.yml"
  )

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

# Client maintainer: blowekamp@mail.nih.gov
set(CTEST_SITE "appveyor")
set(CTEST_DASHBOARD_ROOT $ENV{APPVEYOR_BUILD_FOLDER}/..)
string(SUBSTRING $ENV{APPVEYOR_REPO_COMMIT} 0 7 commit)

# Extract major/minor/patch  versions

set(what "$ENV{APPVEYOR_PULL_REQUEST_TITLE}_#$ENV{APPVEYOR_PULL_REQUEST_NUMBER}")
if("$ENV{APPVEYOR_PULL_REQUEST_NUMBER}" STREQUAL "")
  set(what "$ENV{APPVEYOR_REPO_BRANCH}")
endif()
set(CTEST_CONFIGURATION_TYPE $ENV{CONFIGURATION})
set(CTEST_CMAKE_GENERATOR "$ENV{GENERATOR}")
if("${CTEST_CMAKE_GENERATOR}" STREQUAL "")
  set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008")
endif()

set(platform $ENV{PLATFORM})

set(CTEST_BUILD_NAME "$ENV{ITK_MODULE_NAME}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}")

list(APPEND CTEST_NOTES_FILES
#  The PROJ_SRC env contains another %env% which is not being evaluated
#  "$ENV{PROJ_SRC}/appveyor.yml"
  )

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

Fix build failure due to upload file name

The following error was occurring during uploading:
Problem reading file: %APPVEYOR_BUILD_FOLDER%/appveyor.yml while
creating notes

The dependent envs in the envs appear to not be evaluated.


# DownloadLcbDeb(url location)
MACRO(DOWNLOAD_LCB_DEP url dest)
    IF(UNIX)
        MESSAGE(STATUS "Downloading ${url} => ${dest}")
        EXECUTE_PROCESS(COMMAND wget -O "${dest}" "${url}")
    ELSEIF(WIN32)
        EXECUTE_PROCESS(COMMAND powershell -Command
            "(New-Object Net.WebClient).DownloadFile('${url}', '${dest}')")
    ELSE()
        MESSAGE(WARNING "Using buggy built-in CMake downloader")
        FILE(DOWNLOAD ${url} ${dest} INACTIVITY_TIMEOUT 30 SHOW_PROGRESS)
    ENDIF()
ENDMACRO()

# DownloadLcbDeb(url location)
FIND_PROGRAM(WGET wget)
FIND_PROGRAM(CURL curl)
MACRO(DOWNLOAD_LCB_DEP url dest)
    IF(WIN32)
        EXECUTE_PROCESS(COMMAND powershell -Command
            "(New-Object Net.WebClient).DownloadFile('${url}', '${dest}')" RESULT_VARIABLE DLRC)
    ELSEIF(CURL)
        EXECUTE_PROCESS(COMMAND "${CURL}" "${url}" -o "${dest}" RESULT_VARIABLE DLRC)
    ELSEIF(WGET)
        EXECUTE_PROCESS(COMMAND "${WGET}" "${url}" -O "${dest}" RESULT_VARIABLE DLRC)
    ELSE()
        MESSAGE(WARNING "Using buggy built-in CMake downloader")
        FILE(DOWNLOAD ${url} ${dest} INACTIVITY_TIMEOUT 30 SHOW_PROGRESS)
        SET(DLRC 0)
    ENDIF()
    IF(NOT DLRC EQUAL 0)
        MESSAGE(FATAL_ERROR "Failed to download ${url}")
    ENDIF()
ENDMACRO()

Allow download script to use wget or curl

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


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

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

# "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 "665ede7a8669d441d02e4eb3be635b740d0ef190")

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

Update FW: stereo fixes, stereo/ColorCamera improvements


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

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

# "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 "2f108d8888ca6c318efba10fb0a8859d1e21d2dc")

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

Update FW: improve OV9782 colors

Update FW: improve OV9782 colors


set(UPDATE_TYPE "true")

set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/tests/valgrind-csync.supp)

set(CTEST_PROJECT_NAME "csync")
set(CTEST_NIGHTLY_START_TIME "01:00:00 CET")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "mock.cryptomilk.org")
set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}")
set(CTEST_DROP_SITE_CDASH TRUE)

set(UPDATE_TYPE "true")

set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/tests/valgrind-csync.supp)

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

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "mock.cryptomilk.org")
set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}")
set(CTEST_DROP_SITE_CDASH TRUE)

Set nightly start time to UTC.

cmake: Set nightly start time to UTC.


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

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

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

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

Update mdk - RGB-depth alignment

Update mdk - RGB-depth alignment


include(${CMAKE_CURRENT_LIST_DIR}/Minimal.cmake)

list(APPEND enabled_modules
  CommandLine
  CoreCmdApps
)

include(${CMAKE_CURRENT_LIST_DIR}/Minimal.cmake)

list(APPEND enabled_modules
  AlgorithmsExt
  Annotation
  CommandLine
  ContourModel
  CoreCmdApps
  DataTypesExt
  DICOMPM
  DICOMPMIO
  DICOMQI
  DICOMReader
  DICOMReaderServices
  DicomRT
  DicomRTIO
  DICOMSegIO
  ModelFit
  Multilabel
  MultilabelIO
  LegacyGL
  SceneSerialization
  SceneSerializationBase
)

Add auto-load modules for DICOM IO

Add auto-load modules for DICOM IO

DICOM, DICOM PM, DICOM RT, DICOM SEG, MITK Multilabel


include(matviz.bundle.common)

set (CPACK_GENERATOR DragNDrop)
include(CPack)

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

     file(WRITE \"\${CMAKE_INSTALL_PREFIX}/matviz.app/Contents/Resources/qt.conf\"
                \"\")
     execute_process(
       COMMAND ${CMAKE_CURRENT_LIST_DIR}/fixup_bundle.py
               \"\${CMAKE_INSTALL_PREFIX}/matviz.app\"
               \"${install_location}/lib\"
               \"${install_location}/plugins\")
   "
   COMPONENT superbuild)

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

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

Remove ParaView from the DMG

Remove ParaView from the DMG


###############################################################################
#  Copyright Kitware Inc.
#
#  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.
###############################################################################

add_python_style_test(
  python_static_analysis_HistomicsTK_api
  "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/server"
)

add_python_style_test(
  python_static_analysis_HistomicsTK_algorithms
  "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/histomicstk"
)

add_python_style_test(
  python_static_analysis_HistomicsTK_examples
  "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/examples"
)

add_python_test(example PLUGIN HistomicsTK)

###############################################################################
#  Copyright Kitware Inc.
#
#  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.
###############################################################################

add_python_style_test(
  python_static_analysis_HistomicsTK_api
  "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/server"
)
add_python_style_test(
  python_static_analysis_HistomicsTK_tests
  "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/plugin_tests"
)
add_python_style_test(
  python_static_analysis_HistomicsTK_algorithms
  "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/histomicstk"
)
add_python_style_test(
  python_static_analysis_HistomicsTK_examples
  "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/examples"
)

add_python_test(example PLUGIN HistomicsTK)

Add style testing to the Python tests

Add style testing to the Python tests


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

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

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

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

Update FW: OV9282/9782 img orientation per camera, fix sync mode


get_filename_component(_ITKExternalData_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${_ITKExternalData_DIR}/ExternalData.cmake)
set(ExternalData_URL_TEMPLATES "" CACHE STRING
  "Additional URL templates for the ExternalData CMake script to look for testing data. E.g.
file:///var/bigharddrive/%(algo)/%(hash)")
mark_as_advanced(ExternalData_URL_TEMPLATES)
list(APPEND ExternalData_URL_TEMPLATES
  # Local data store populated by the ITK pre-commit hook
  "file:///${CMAKE_SOURCE_DIR}/.ExternalData/%(algo)/%(hash)"

  # Data published by MIDAS
  "http://midas.kitware.com/api/rest/midas.bitstream.by.hash?hash=%(hash)&algorithm=%(algo)"

  # Data published by developers using git-gerrit-push.
  "http://www.itk.org/files/ExternalData/%(algo)/%(hash)"
  )

# Tell ExternalData commands to transform raw files to content links.
# TODO: Condition this feature on presence of our pre-commit hook.
set(ExternalData_LINK_CONTENT MD5)

get_filename_component(_ITKExternalData_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${_ITKExternalData_DIR}/ExternalData.cmake)

set(ExternalData_OBJECT_STORES "" CACHE STRING
  "Semicolon-separated list of local directories holding data objects in the layout %(algo)/%(hash).")
mark_as_advanced(ExternalData_OBJECT_STORES)
if(NOT ExternalData_OBJECT_STORES)
  set(ExternalData_OBJECT_STORES "${CMAKE_BINARY_DIR}/ExternalData/Objects")
  file(MAKE_DIRECTORY "${ExternalData_OBJECT_STORES}")
endif()
list(APPEND ExternalData_OBJECT_STORES
  # Local data store populated by the ITK pre-commit hook
  "${CMAKE_SOURCE_DIR}/.ExternalData"
  )

set(ExternalData_URL_TEMPLATES "" CACHE STRING
  "Additional URL templates for the ExternalData CMake script to look for testing data. E.g.
file:///var/bigharddrive/%(algo)/%(hash)")
mark_as_advanced(ExternalData_URL_TEMPLATES)
list(APPEND ExternalData_URL_TEMPLATES
  # Data published by MIDAS
  "http://midas.kitware.com/api/rest/midas.bitstream.by.hash?hash=%(hash)&algorithm=%(algo)"

  # Data published by developers using git-gerrit-push.
  "http://www.itk.org/files/ExternalData/%(algo)/%(hash)"
  )

# Tell ExternalData commands to transform raw files to content links.
# TODO: Condition this feature on presence of our pre-commit hook.
set(ExternalData_LINK_CONTENT MD5)

ENH: Configure ExternalData local object stores for ITK

Expose ExternalData option ExternalData_OBJECT_STORES as a cache entry
defaulting to the empty string.  If not set, use a directory in the
build tree as the main store.  Either way, add the .ExternalData
directory at the top of the source tree as a local object store.  Remove
the latter from the URL templates list so that the objects can be used
without copying to another local store.

Change-Id: I0b454872ad4855e28bd03351c41b6cd02f107204


#------------------------------------------------------------------------------
# Strip Option

# Add option to strip wrapping libraries.
# Since the wrapping libraries don't get installed by the normal cmake
# installation process, this option enables stripping of the libraries
# as part of the build process. It should be used on the laguage
# targets and the the SimpleITK iterface, as those can be installed
# into the system.
option(SimpleITK_BUILD_STRIP "Strip executables and libraries after building." OFF)
mark_as_advanced(SimpleITK_BUILD_STRIP)
set(CMAKE_STRIP_FLAGS "-x" CACHE STRING "Flags used by strip in the post_build.")
mark_as_advanced(CMAKE_STRIP_FLAGS)
separate_arguments(CMAKE_STRIP_FLAGS)

function(sitk_strip_target tgt)
  if(NOT SimpleITK_BUILD_STRIP)
    return()
  endif()
  get_property(type TARGET ${tgt} PROPERTY TYPE)
  if(NOT type STREQUAL STATIC_LIBRARY)
    add_custom_command(
      TARGET ${tgt}
      POST_BUILD
      COMMAND ${CMAKE_STRIP} ${CMAKE_STRIP_FLAGS} "$<TARGET_FILE:${tgt}>"
      )
  endif()

endfunction()

#------------------------------------------------------------------------------
# Strip Option

# Add option to strip wrapping libraries.
# Since the wrapping libraries don't get installed by the normal cmake
# installation process, this option enables stripping of the libraries
# as part of the build process. It should be used on the laguage
# targets and the the SimpleITK iterface, as those can be installed
# into the system.
option(SimpleITK_BUILD_STRIP "Strip executables and libraries after building." OFF)
mark_as_advanced(SimpleITK_BUILD_STRIP)
set(CMAKE_STRIP_FLAGS "-x" CACHE STRING "Flags used by strip in the post_build.")
mark_as_advanced(CMAKE_STRIP_FLAGS)
separate_arguments(CMAKE_STRIP_FLAGS)

function(sitk_strip_target tgt)
  if(NOT SimpleITK_BUILD_STRIP OR "${CMAKE_STRIP}" STREQUAL "" )
    return()
  endif()
  get_property(type TARGET ${tgt} PROPERTY TYPE)
  if(NOT type STREQUAL STATIC_LIBRARY)
    add_custom_command(
      TARGET ${tgt}
      POST_BUILD
      COMMAND ${CMAKE_STRIP} ${CMAKE_STRIP_FLAGS} "$<TARGET_FILE:${tgt}>"
      )
  endif()

endfunction()

Disable stripping post build step if CMAKE_STRIP is empty

Change-Id: I5db6e3b5c3e6465f37231d8fb9ab5b6679ecc4c5


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

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

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

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

Update FW: fix OV9782 bayer order

Update FW: fix OV9782 bayer order


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

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

# "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 "3aef66802d697e1f5b3c77830455379e46d9d426")

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

Update FW/mdk - Optimizing the confidence map alignment(CleanUp - remove global variables)


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

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

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

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

Allow using AR0234/OV5645 (but at degraded image quality) with other sensors enabled at the same time


IF (UNIX AND NOT APPLE)
	SET(COMPONENT_PLUGINS "")
ELSEIF(APPLE)
	SET(COMPONENT_PLUGINS "BALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-plugins")
ELSEIF(WIN32)
	SET(COMPONENT_PLUGINS "")
ENDIF()

IF (COMPONENT_PLUGINS)
	SET_COMPONENT_NAME(${COMPONENT_PLUGINS}
		"SpaceNavigator plugin"
		"Plugin adding support for 3Dconnexion SpaceNavigator input device"
	)

	SET_COMPONENT_DEPENDENCIES(${COMPONENT_PLUGINS} ${COMPONENT_LIBVIEW})
ENDIF()

IF (UNIX AND NOT APPLE)
	SET(COMPONENT_PLUGINS "")
ELSEIF(APPLE)
	SET(COMPONENT_PLUGINS "BALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-plugins")
ELSEIF(WIN32)
	SET(COMPONENT_PLUGINS "")
ENDIF()

IF (COMPONENT_PLUGINS)
	SET_COMPONENT_NAME(${COMPONENT_PLUGINS}
		"BALLView plugins"
		"Plugins extending BALLView's functionality"
	)

	SET_COMPONENT_DEPENDENCIES(${COMPONENT_PLUGINS} ${COMPONENT_LIBVIEW})
ENDIF()

Fix description of Plugins in installer.


set(PBM_PREFIX protobuf_mutator)
set(PBM_PATH ${CMAKE_CURRENT_BINARY_DIR}/${PBM_PREFIX}/src/${PBM_PREFIX})
set(PBM_LIB_PATH ${PBM_PATH}/src/libprotobuf-mutator.a)
set(PBM_FUZZ_LIB_PATH ${PBM_PATH}/src/libfuzzer/libprotobuf-mutator-libfuzzer.a)

ExternalProject_Add(${PBM_PREFIX}
  PREFIX ${PBM_PREFIX}
  GIT_REPOSITORY https://github.com/google/libprotobuf-mutator.git
  GIT_TAG master
  CONFIGURE_COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR}
    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
    -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
  BUILD_BYPRODUCTS ${PBM_LIB_PATH} ${PBM_FUZZ_LIB_PATH}
  BUILD_IN_SOURCE 1
  INSTALL_COMMAND ""
  LOG_DOWNLOAD 1
  LOG_CONFIGURE 1
  LOG_BUILD 1
  )

set(ProtobufMutator_INCLUDE_DIRS ${PBM_PATH})
set(ProtobufMutator_LIBRARIES ${PBM_FUZZ_LIB_PATH} ${PBM_LIB_PATH})

set(PBM_PREFIX protobuf_mutator)
set(PBM_PATH ${CMAKE_CURRENT_BINARY_DIR}/${PBM_PREFIX}/src/${PBM_PREFIX})
set(PBM_LIB_PATH ${PBM_PATH}-build/src/libprotobuf-mutator.a)
set(PBM_FUZZ_LIB_PATH ${PBM_PATH}-build/src/libfuzzer/libprotobuf-mutator-libfuzzer.a)

ExternalProject_Add(${PBM_PREFIX}
  PREFIX ${PBM_PREFIX}
  GIT_REPOSITORY https://github.com/google/libprotobuf-mutator.git
  GIT_TAG master
  CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
                   -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
  BUILD_BYPRODUCTS ${PBM_LIB_PATH} ${PBM_FUZZ_LIB_PATH}
  UPDATE_COMMAND ""
  INSTALL_COMMAND ""
  )

set(ProtobufMutator_INCLUDE_DIRS ${PBM_PATH})
set(ProtobufMutator_LIBRARIES ${PBM_FUZZ_LIB_PATH} ${PBM_LIB_PATH})

Fix incremental builds of the fuzzer

[clang-fuzzer] Fix incremental builds of the fuzzer

Summary:
Don't use BUILD_IN_SOURCE keep git checkout clean
Don't forward CMAKE_GENERATOR as ExternalProject_Add should do it already
Reset UPDATE_COMMAND to avoid git checkout updates on each build

Reviewers: kcc, morehouse

Subscribers: cfe-commits, mgorny

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@317035 91177308-0d34-0410-b5e6-96231b3b80d8


# Find Phonon

# Copyright (c) 2010, Harald Sitter <sitter@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (NOT PHONON_BUILDSYSTEM_DIR)
    find_program(PC_EXECUTABLE NAMES pkg-config
    PATH_SUFFIXES bin
    HINTS
    ${CMAKE_INSTALL_PREFIX}
    ONLY_CMAKE_FIND_ROOT_PATH
    )

    if (NOT PC_EXECUTABLE)
        if (Phonon_FIND_REQUIRED)
            message(FATAL_ERROR "ERROR: Could not find pkg-config [required to find Phonon].")
        endif (Phonon_FIND_REQUIRED)
    endif (NOT PC_EXECUTABLE)

    if (PC_EXECUTABLE)
        execute_process(COMMAND "${PC_EXECUTABLE}" --variable=buildsystemdir phonon
                        OUTPUT_VARIABLE _data_DIR
                        ERROR_QUIET
                        OUTPUT_STRIP_TRAILING_WHITESPACE)
        file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
        find_path(PHONON_BUILDSYSTEM_DIR FindPhononInternal.cmake HINTS ${_data_DIR})
    endif (PC_EXECUTABLE)
endif (NOT PHONON_BUILDSYSTEM_DIR)

if (PHONON_BUILDSYSTEM_DIR)
    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PHONON_BUILDSYSTEM_DIR})

    if (Phonon_FIND_REQUIRED)
        set(_req REQUIRED)
    endif (Phonon_FIND_REQUIRED)
    if (PHONON_FIND_QUIETLY)
        set(_quiet QUIET)
    endif (PHONON_FIND_QUIETLY)

    find_package(PhononInternal ${_req} ${_quiet})
else (PHONON_BUILDSYSTEM_DIR)
    if (_data_DIR)
        if (Phonon_FIND_REQUIRED)
            message(FATAL_ERROR "ERROR: FindPhonon.cmake not found in ${_data_DIR}")
        endif (Phonon_FIND_REQUIRED)
    else (_data_DIR)
        if (Phonon_FIND_REQUIRED)
            message(FATAL_ERROR "ERROR: Either pkg-config can not find its phonon config, or you are not using a recent enough Phonon version.")
        endif (Phonon_FIND_REQUIRED)
    endif (_data_DIR)
endif (PHONON_BUILDSYSTEM_DIR)

# Find Phonon

# Copyright (c) 2010, Harald Sitter <sitter@kde.org>
# Copyright (c) 2011, Alexander Neundorf <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

find_package(Phonon NO_MODULE)
if(PHONON_FOUND)
    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PHONON_BUILDSYSTEM_DIR})
endif()

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Phonon  DEFAULT_MSG  Phonon_DIR )

Adjust the GST backend to the way phonon is installed now (see phonon-vlc's related commit)


#.rst:
#
# Finds Lua
#
# Variables used::
#
#   LUA_ROOT
#
# autocmake.yml configuration::
#
#   docopt: "--lua=<LUA_ROOT> Specify the path to the Lua installation to use [default: '']."
#   define: "'-DLUA_ROOT=\"{0}\"'.format(arguments['--lua'])"

option_with_default(LUA_ROOT "Specify the path to the Lua installation to use" "")
if(LUA_ROOT)
  list(APPEND CMAKE_PREFIX_PATH ${LUA_ROOT})
endif()
find_package(Lua 5.3 EXACT REQUIRED)

# Append the dl library to the LUA_LIBRARIES list for a statically
# linked Lua library.
# This contraption is needed for CMake older than 3.6.0
# This is adapted from:
# https://github.com/Kitware/CMake/blob/v3.8.2/Modules/FindLua.cmake
if(CMAKE_VERSION VERSION_LESS 3.8.0)
  if(UNIX AND NOT APPLE AND NOT BEOS)
    # include dl library for statically-linked Lua library
    get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
    if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
      list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
    endif()
  endif()
endif()

Append dl library to LUA_LIBRARIES list

Append dl library to LUA_LIBRARIES list


set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SOURCES ${SOURCES}
            ${CMAKE_CURRENT_LIST_DIR}/src/plugin.h
            ${CMAKE_CURRENT_LIST_DIR}/src/core/device.h
            ${CMAKE_CURRENT_LIST_DIR}/src/core/units.h
            ${CMAKE_CURRENT_LIST_DIR}/src/plugin.cpp
            ${CMAKE_CURRENT_LIST_DIR}/src/core/device.cpp
            ${CMAKE_CURRENT_LIST_DIR}/src/core/units.cpp
            ${CMAKE_CURRENT_LIST_DIR}/src/material.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/components/components.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/controls/controls.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/core/core.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/extras/extras.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/listitems/listitems.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/popups/popups.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/styles/styles.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/window/window.qrc
            ${CMAKE_CURRENT_LIST_DIR}/icons/core_icons.qrc)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(VENDOR_SOURCES ${VENDOR_SOURCES}
            ${CMAKE_CURRENT_LIST_DIR}/src/plugin.h
            ${CMAKE_CURRENT_LIST_DIR}/src/core/device.h
            ${CMAKE_CURRENT_LIST_DIR}/src/core/units.h
            ${CMAKE_CURRENT_LIST_DIR}/src/plugin.cpp
            ${CMAKE_CURRENT_LIST_DIR}/src/core/device.cpp
            ${CMAKE_CURRENT_LIST_DIR}/src/core/units.cpp
            ${CMAKE_CURRENT_LIST_DIR}/src/material.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/components/components.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/controls/controls.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/core/core.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/extras/extras.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/listitems/listitems.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/popups/popups.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/styles/styles.qrc
            ${CMAKE_CURRENT_LIST_DIR}/src/window/window.qrc
            ${CMAKE_CURRENT_LIST_DIR}/icons/core_icons.qrc)

Use VENDOR_SOURCES instead of SOURCES

fix(cmake): Use VENDOR_SOURCES instead of SOURCES


# Copyright (c) 2019, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause

set(CTEST_CUSTOM_ERROR_POST_CONTEXT 50)
set(CTEST_CUSTOM_ERROR_PRE_CONTEXT 50)
set(CTEST_CUSTOM_POST_TEST ./test/print_info)

list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
  "test"

  # All external and third_party libraries
  "extern/.*"
  "test/mmio/.*"
  "src/backend/cpu/threads/.*"
  "src/backend/cuda/cub/.*"
  "cl2.hpp"

  # Remove bin2cpp from coverage
  "CMakeModules/.*")

# Copyright (c) 2019, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause

set(CTEST_CUSTOM_ERROR_POST_CONTEXT 50)
set(CTEST_CUSTOM_ERROR_PRE_CONTEXT 50)
if(WIN32)
  set(CTEST_CUSTOM_POST_TEST ./bin/print_info.exe)
else()
  set(CTEST_CUSTOM_POST_TEST ./test/print_info)
endif()

list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
  "test"

  # All external and third_party libraries
  "extern/.*"
  "test/mmio/.*"
  "src/backend/cpu/threads/.*"
  "src/backend/cuda/cub/.*"
  "cl2.hpp"

  # Remove bin2cpp from coverage
  "CMakeModules/.*")

Put print_info in the ArrayFire_BINARY_DIR for all Operating systems

The windows runtime binary directory is different than other operating
systems. This causes issues with the print_info command in the
CTEST_CUSTOM_POST_TEST command because it is located in a different
location on windows. This sets the runtime output directory to the
same location on all OSs for print_info


#
# Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# 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.
#

#Contact: Gaëlle USSEGLIO
otb_fetch_module(DiapOTBModule
  "OTB module for SAR processing in Diapason."
  GIT_REPOSITORY https://gitlab.orfeo-toolbox.org/remote_modules/diapotb.git
  GIT_TAG f84b85352abb75ff3eefafdf0480fcde7fa06173
)

#
# Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# 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.
#

#Contact: Gaëlle USSEGLIO
otb_fetch_module(DiapOTBModule
  "OTB module for SAR processing in Diapason."
  GIT_REPOSITORY https://gitlab.orfeo-toolbox.org/remote_modules/diapotb.git
  GIT_TAG 3a058ebdf2a1dc18d5136f322324837065d5ef75
)

Set the correct branch to use for DiapOTB


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

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

# "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 "8bed558dd19e25bc4b07f716c0c6a494050e0f81")

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

Update IMU driver for CM4-POE

Update IMU driver for CM4-POE


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

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

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

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

Update FW; do subpixel interpolation for extended mode too


itk_fetch_module(SimpleITKFilters
  "A Collection of filters designed for SimpleITK.
  The filters in this module may be wrappers of composites ITK
  filters, adapters of existing ITK filters or alternative
  implementations designed for SimpleITK's requirements. Currently it
  contains a discrete hessian, and a composite filter to compute objectness."
  GIT_REPOSITORY ${git_protocol}://github.com/SimpleITK/ITKSimpleITKFilters.git
  GIT_TAG a1698352ab83cffd0a06a6d97116b48650a3edbd
  )

itk_fetch_module(SimpleITKFilters
  "A Collection of filters designed for SimpleITK.
  The filters in this module may be wrappers of composites ITK
  filters, adapters of existing ITK filters or alternative
  implementations designed for SimpleITK's requirements. Currently it
  contains a discrete hessian, and a composite filter to compute objectness."
  GIT_REPOSITORY ${git_protocol}://github.com/SimpleITK/ITKSimpleITKFilters.git
  GIT_TAG 5f33d89915528b32f0b67f3c05497a91bfe54a9c
  )

COMP: Update SimpleITKFilters for dependency issues

Add GoogleTest module dependency. Move usage of data from the
ITK_DATA_ROOT, to hash files in this repository.

Change-Id: I33fe7b59ac3d462d600a795135b0d0c3244f6b72


set(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CONFIG_FLAGS @CONFIG_FLAGS@)

set(DIR StandaloneBuild)
execute_process(
    COMMAND "${CMAKE_COMMAND}" -E echo "Clearing build..."
    COMMAND "${CMAKE_COMMAND}" -E remove_directory "${DIR}"
    COMMAND "${CMAKE_COMMAND}" -E make_directory "${DIR}")
execute_process(
    COMMAND "${CMAKE_COMMAND}" -E echo "Configuring..."
    COMMAND "${CMAKE_COMMAND}" -E echo "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" ${CONFIG_FLAGS} "${SOURCE_DIR}"
    COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" ${CONFIG_FLAGS} "${SOURCE_DIR}"
    COMMAND "${CMAKE_COMMAND}" -E echo "Compiling..."
    COMMAND "${CMAKE_COMMAND}" -E echo "${CMAKE_COMMAND}" --build "." ${BUILD_FLAGS}
    COMMAND "${CMAKE_COMMAND}" --build "." ${BUILD_FLAGS}
    WORKING_DIRECTORY "${DIR}"
    RESULT_VARIABLE RES)

if(NOT RES EQUAL 0)
    message(FATAL_ERROR "Got Result ${RES}")
endif()

message(STATUS "Result ${RES}")

set(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CONFIG_FLAGS @CONFIG_FLAGS@)

set(DIR "${CMAKE_CURRENT_LIST_DIR}/StandaloneBuild")
macro(run)
    execute_process(COMMAND "${CMAKE_COMMAND}" -E echo ${ARGN})
    execute_process(
        COMMAND ${ARGN}
        WORKING_DIRECTORY "${DIR}"
        RESULT_VARIABLE RES)
    if(NOT RES EQUAL 0)
        message(FATAL_ERROR "Got Result ${RES}")
    endif()
endmacro()

message(STATUS "Clearing build...")
execute_process(COMMAND "${CMAKE_COMMAND}" -E remove_directory "${DIR}")
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${DIR}")

message(STATUS "Configuring...")
run("${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" ${CONFIG_FLAGS} "${SOURCE_DIR}")

message(STATUS "Compiling...")
run("${CMAKE_COMMAND}" --build "." ${BUILD_FLAGS})

message(STATUS "Result ${RES}")

Change the way the self-contained build test is run.


option(
  ENABLE_CPPCHECK
  "Enable static analysis with cppcheck"
  OFF
)
option(
  ENABLE_CLANG_TIDY
  "Enable static analysis with clang-tidy"
  OFF
)
option(
  CLANG_TIDY_RUNNER
  "Name of clang-tidy runner"
  "run-clang-tidy-9"
)

if(ENABLE_CPPCHECK)
  find_program(CPPCHECK cppcheck HINTS /usr/local/bin)

  if(CPPCHECK)
    list(
      APPEND
      CPPCHECK_ARGS
      --enable=all
      --inconclusive
      --error-exitcode=1
      --language=c++
      --inline-suppr
      # cmake-format: off
    --template='{file}:{line} [{severity}/{id}]: {message}'
    # cmake-format: on
      --project=${CMAKE_BINARY_DIR}/compile_commands.json
    )
    set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
    add_custom_target(
      cppcheck ALL
      COMMAND ${CPPCHECK} ${CPPCHECK_ARGS}
      COMMENT "running cppcheck"
    )
  else()
    message(SEND_ERROR "cppcheck requested but executable not found")
  endif()
endif()

if(ENABLE_CLANG_TIDY)
  find_program(RUNNER ${CLANG_TIDY_RUNNER})
  if(RUNNER)
    set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
    add_custom_target(
      clang-tidy ALL
      COMMAND ${RUNNER}
      COMMENT "running clang-tidy"
    )
  else()
    message(SEND_ERROR "clang-tidy requested but clang-tidy runner is not found")
  endif()
endif()

option(
  ENABLE_CPPCHECK
  "Enable static analysis with cppcheck"
  OFF
)
option(
  ENABLE_CLANG_TIDY
  "Enable static analysis with clang-tidy"
  OFF
)
set(CLANG_TIDY_RUNNER
    "run-clang-tidy-9"
    CACHE STRING "Name of clang-tidy runner"
)

if(ENABLE_CPPCHECK)
  find_program(CPPCHECK cppcheck HINTS /usr/local/bin)

  if(CPPCHECK)
    list(
      APPEND
      CPPCHECK_ARGS
      --enable=all
      --inconclusive
      --error-exitcode=1
      --language=c++
      --inline-suppr
      # cmake-format: off
    --template='{file}:{line} [{severity}/{id}]: {message}'
    # cmake-format: on
      --project=${CMAKE_BINARY_DIR}/compile_commands.json
    )
    set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
    add_custom_target(
      cppcheck ALL
      COMMAND ${CPPCHECK} ${CPPCHECK_ARGS}
      COMMENT "running cppcheck"
    )
  else()
    message(SEND_ERROR "cppcheck requested but executable not found")
  endif()
endif()

if(ENABLE_CLANG_TIDY)
  find_program(RUNNER ${CLANG_TIDY_RUNNER})
  if(RUNNER)
    set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
    add_custom_target(
      clang-tidy ALL
      COMMAND ${RUNNER}
      COMMENT "running clang-tidy"
    )
  else()
    message(SEND_ERROR "clang-tidy requested but clang-tidy runner is not found")
  endif()
endif()

Fix CLANG_TIDY_RUNNER option to have string type


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

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

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

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

Update FW: openvino 2021.4.2 support

Update FW: openvino 2021.4.2 support


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

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

# "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 "2a09cdb35cbbaedaf91f505bc78c2b3129f93479")

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

Update device FW after merge with latest `gen2`


find_package(PkgConfig)
pkg_check_modules(PC_libyaml libyaml>=2.7)

find_path(libyaml_INCLUDE_DIR yaml.h
          HINTS ${PC_libyaml_INCLUDEDIR} ${PC_libyaml_INCLUDE_DIRS})

find_library(libyaml_LIBRARY NAMES libyaml
             HINTS ${PC_libyaml_LIBDIR} ${PC_libyaml_LIBRARY_DIRS} )

set(libyaml_LIBRARIES ${libyaml_LIBRARY})
set(libyaml_INCLUDE_DIRS ${libyaml_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libyaml DEFAULT_MSG
                                  libyaml_LIBRARY libyaml_INCLUDE_DIR)

mark_as_advanced(libyaml_INCLUDE_DIR libyaml_LIBRARY )

find_package(PkgConfig)
pkg_check_modules(PC_libyaml libyaml>=0.1.6)

find_path(libyaml_INCLUDE_DIR yaml.h
          HINTS ${PC_libyaml_INCLUDEDIR} ${PC_libyaml_INCLUDE_DIRS})

find_library(libyaml_LIBRARY NAMES yaml libyaml
             HINTS ${PC_libyaml_LIBDIR} ${PC_libyaml_LIBRARY_DIRS} )

set(libyaml_LIBRARIES ${libyaml_LIBRARY})
set(libyaml_INCLUDE_DIRS ${libyaml_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libyaml DEFAULT_MSG
                                  libyaml_LIBRARY libyaml_INCLUDE_DIR)

mark_as_advanced(libyaml_INCLUDE_DIR libyaml_LIBRARY )

Fix libyaml version in configure.

Fix libyaml version in configure.


string(TOLOWER ${PROJECT_NAME} LOWER_PROJECT_NAME)

if(NOT ${PROJECT_NAME}_BUILD_SINGLE_LIBRARY)
  add_library(${LOWER_PROJECT_NAME}${KIT}3D ${kit_SRCS3D})
  set_target_properties(${LOWER_PROJECT_NAME}${KIT}3D PROPERTIES COMPILE_DEFINITIONS NDIM=3)

  if(${PROJECT_NAME}_BUILD_2D_LIBRARY)
    add_library(${LOWER_PROJECT_NAME}${KIT}2D ${kit_SRCS2D})
    set_target_properties(${LOWER_PROJECT_NAME}${KIT}2D PROPERTIES COMPILE_DEFINITIONS NDIM=2)
  endif()
else()
  add_library(${LOWER_PROJECT_NAME}${KIT}3D OBJECT ${kit_SRCS3D})
  if(BUILD_SHARED_LIBS)
    set_target_properties(${LOWER_PROJECT_NAME}${KIT}3D PROPERTIES COMPILE_FLAGS "-fPIC")
  endif()
  set_target_properties(${LOWER_PROJECT_NAME}${KIT}3D PROPERTIES COMPILE_DEFINITIONS NDIM=3)
  if(${PROJECT_NAME}_BUILD_2D_LIBRARY)
    add_library(${LOWER_PROJECT_NAME}${KIT}2D OBJECT ${kit_SRCS2D})
    if(BUILD_SHARED_LIBS)
      set_target_properties(${LOWER_PROJECT_NAME}${KIT}2D PROPERTIES COMPILE_FLAGS "-fPIC")
    endif()
    set_target_properties(${LOWER_PROJECT_NAME}${KIT}2D PROPERTIES COMPILE_DEFINITIONS NDIM=2)
  endif()
endif()

string(TOLOWER ${PROJECT_NAME} LOWER_PROJECT_NAME)

set(KIT3D ${LOWER_PROJECT_NAME}${KIT}3D)
set(KIT2D ${LOWER_PROJECT_NAME}${KIT}2D)

if(NOT ${PROJECT_NAME}_BUILD_SINGLE_LIBRARY)
  add_library(${KIT3D} ${kit_SRCS3D})
  set_target_properties(${KIT3D} PROPERTIES COMPILE_DEFINITIONS NDIM=3)
  add_dependencies(${KIT3D} IBTK-Build)

  if(${PROJECT_NAME}_BUILD_2D_LIBRARY)
    add_library(${KIT2D} ${kit_SRCS2D})
    set_target_properties(${KIT2D} PROPERTIES COMPILE_DEFINITIONS NDIM=2)
    add_dependencies(${KIT2D} IBTK-Build)
  endif()
else()
  add_library(${KIT3D} OBJECT ${kit_SRCS3D})
  if(BUILD_SHARED_LIBS)
    set_target_properties(${KIT3D} PROPERTIES COMPILE_FLAGS "-fPIC")
  endif()
  set_target_properties(${KIT3D} PROPERTIES COMPILE_DEFINITIONS NDIM=3)
  add_dependencies(${KIT3D} IBTK-Build)
  if(${PROJECT_NAME}_BUILD_2D_LIBRARY)
    add_library(${KIT2D} OBJECT ${kit_SRCS2D})
    if(BUILD_SHARED_LIBS)
      set_target_properties(${KIT2D} PROPERTIES COMPILE_FLAGS "-fPIC")
    endif()
    set_target_properties(${KIT2D} PROPERTIES COMPILE_DEFINITIONS NDIM=2)
    add_dependencies(${KIT2D} IBTK-Build)
  endif()
endif()

Add library dependency to superbuild

Add library dependency to superbuild


#################################################
macro (ign_build_tests)
  # Build all the tests
  foreach(GTEST_SOURCE_file ${ARGN})
    string(REGEX REPLACE ".cc" "" BINARY_NAME ${GTEST_SOURCE_file})
    set(BINARY_NAME ${TEST_TYPE}_${BINARY_NAME})
    if(USE_LOW_MEMORY_TESTS)
      add_definitions(-DUSE_LOW_MEMORY_TESTS=1)
    endif(USE_LOW_MEMORY_TESTS)
    add_executable(${BINARY_NAME} ${GTEST_SOURCE_file} ${PROTO_SRC})

    add_dependencies(${BINARY_NAME}
      ${PROJECT_NAME_LOWER}
      gtest gtest_main
      protobuf_compilation
      )

    target_link_libraries(${BINARY_NAME}
      ${PROJECT_NAME_LOWER}
      libgtest.a
      libgtest_main.a
      pthread
      )

    add_test(${BINARY_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}
	--gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)

    set_tests_properties(${BINARY_NAME} PROPERTIES TIMEOUT 240)

    # Check that the test produced a result and create a failure if it didn't.
    # Guards against crashed and timed out tests.
    add_test(check_${BINARY_NAME} ${PROJECT_SOURCE_DIR}/tools/check_test_ran.py
	${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)
  endforeach()
endmacro()

#################################################
macro (ign_build_tests)
  # Build all the tests
  foreach(GTEST_SOURCE_file ${ARGN})
    string(REGEX REPLACE ".cc" "" BINARY_NAME ${GTEST_SOURCE_file})
    set(BINARY_NAME ${TEST_TYPE}_${BINARY_NAME})
    if(USE_LOW_MEMORY_TESTS)
      add_definitions(-DUSE_LOW_MEMORY_TESTS=1)
    endif(USE_LOW_MEMORY_TESTS)

    set_source_files_properties(${PROTO_SRC} PROPERTIES GENERATED TRUE)

    add_executable(${BINARY_NAME} ${GTEST_SOURCE_file} ${PROTO_SRC})

    add_dependencies(${BINARY_NAME}
      ${PROJECT_NAME_LOWER}
      gtest gtest_main
      protobuf_compilation
      )

    target_link_libraries(${BINARY_NAME}
      ${PROJECT_NAME_LOWER}
      libgtest.a
      libgtest_main.a
      pthread
      )

    add_test(${BINARY_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}
	--gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)

    set_tests_properties(${BINARY_NAME} PROPERTIES TIMEOUT 240)

    # Check that the test produced a result and create a failure if it didn't.
    # Guards against crashed and timed out tests.
    add_test(check_${BINARY_NAME} ${PROJECT_SOURCE_DIR}/tools/check_test_ran.py
	${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)
  endforeach()
endmacro()

Define protobuf files as GENERATED

Define protobuf files as GENERATED

--HG--
branch : no_ign_msgs


EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "
from sys import stdout
from distutils import sysconfig
path=sysconfig.get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')
stdout.write(path)"
OUTPUT_VARIABLE PYTHON_INSTALL_DIR)

EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "
from sys import stdout
from sysconfig import get_path
path=get_path(name='platlib', vars={'platbase':'${CMAKE_INSTALL_PREFIX}'})
stdout.write(path)"
OUTPUT_VARIABLE PYTHON_INSTALL_DIR)

Remove distutils which are deprecated in python3.10


# BUILD_SHARED_LIBS is a global cmake variable (usually defaults to on)
# that determines the build type of libraries:
#   http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:BUILD_SHARED_LIBS
# It defaults to shared.
#
# Our only current major use case for static libraries is
# via the mingw cross compiler, though embedded builds
# could be feasibly built this way also (largely untested).

option(BUILD_SHARED_LIBS "Build dynamically-linked binaries" ON)

if (BUILD_SHARED_LIBS)
  add_definitions(-DROS_BUILD_SHARED_LIBS=1)
  message(STATUS "BUILD_SHARED_LIBS is on.")
else()
  message(STATUS "BUILD_STATIC_LIBS is on.")
endif()

# BUILD_SHARED_LIBS is a global cmake variable (usually defaults to on)
# that determines the build type of libraries:
#   http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:BUILD_SHARED_LIBS
# It defaults to shared.
#
# Our only current major use case for static libraries is
# via the mingw cross compiler, though embedded builds
# could be feasibly built this way also (largely untested).

option(BUILD_SHARED_LIBS "Build dynamically-linked binaries" ON)

if (BUILD_SHARED_LIBS)
  add_definitions(-DROS_BUILD_SHARED_LIBS=1)
else()
  message(STATUS "BUILD_STATIC_LIBS is off.")
endif()

Remove verbose debug output in the normal case (shared libs on).


# This file provides information and services to the final user.

set(LLVM_PACKAGE_VERSION @PACKAGE_VERSION@)

set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)

set(llvm_libs @llvm_libs@)

set(llvm_lib_targets @llvm_lib_targets@)

set(LLVM_ALL_TARGETS @LLVM_ALL_TARGETS@)

set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)

set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)

set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@)

set(LLVM_NATIVE_ARCH @LLVM_NATIVE_ARCH@)

set(LLVM_ENABLE_PIC @LLVM_ENABLE_PIC@)

set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS)

set(HAVE_LIBDL @HAVE_LIBDL@)
set(HAVE_LIBPTHREAD @HAVE_LIBPTHREAD)

# We try to include using the current setting of CMAKE_MODULE_PATH,
# which suppossedly was filled by the user with the directory where
# this file was installed:
include( LLVMConfig OPTIONAL RESULT_VARIABLE LLVMCONFIG_INCLUDED )

# If failed, we assume that this is an un-installed build:
if( NOT LLVMCONFIG_INCLUDED )
  set(CMAKE_MODULE_PATH
    ${CMAKE_MODULE_PATH}
    "@LLVM_SOURCE_DIR@/cmake/modules")
  include( LLVMConfig )
endif()

# This file provides information and services to the final user.

set(LLVM_PACKAGE_VERSION @PACKAGE_VERSION@)

set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)

set_property( GLOBAL PROPERTY LLVM_LIBS "@llvm_libs@")

set(llvm_lib_targets @llvm_lib_targets@)

set(LLVM_ALL_TARGETS @LLVM_ALL_TARGETS@)

set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)

set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)

set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@)

set(LLVM_NATIVE_ARCH @LLVM_NATIVE_ARCH@)

set(LLVM_ENABLE_PIC @LLVM_ENABLE_PIC@)

set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS)

set(HAVE_LIBDL @HAVE_LIBDL@)
set(HAVE_LIBPTHREAD @HAVE_LIBPTHREAD)

# We try to include using the current setting of CMAKE_MODULE_PATH,
# which suppossedly was filled by the user with the directory where
# this file was installed:
include( LLVMConfig OPTIONAL RESULT_VARIABLE LLVMCONFIG_INCLUDED )

# If failed, we assume that this is an un-installed build:
if( NOT LLVMCONFIG_INCLUDED )
  set(CMAKE_MODULE_PATH
    ${CMAKE_MODULE_PATH}
    "@LLVM_SOURCE_DIR@/cmake/modules")
  include( LLVMConfig )
endif()

Fix breakage on clang standalone build.

CMake: Fix breakage on clang standalone build.

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


# - Compile and run code to check for C++ features
#
# This functions compiles a source file under the `cmake` folder
# and adds the corresponding `HAVE_[FILENAME]` flag to the CMake
# environment
#
#  cxx_feature_check(<FLAG> [<VARIANT>])
#
# - Example
#
# include(CXXFeatureCheck)
# cxx_feature_check(STD_REGEX)
# Requires CMake 2.6+

if(__cxx_feature_check)
  return()
endif()
set(__cxx_feature_check INCLUDED)

function(cxx_feature_check FILE)
  string(TOLOWER ${FILE} FILE)
  string(TOUPPER ${FILE} VAR)
  string(TOUPPER "HAVE_${VAR}" FEATURE)
  message("-- Performing Test ${FEATURE}")
  try_run(RUN_${FEATURE} COMPILE_${FEATURE}
          ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp)
  if(RUN_${FEATURE} EQUAL 0)
    message("-- Performing Test ${FEATURE} -- success")
    set(HAVE_${VAR} 1 PARENT_SCOPE)
    add_definitions(-DHAVE_${VAR})
  else()
    if(NOT COMPILE_${FEATURE})
      message("-- Performing Test ${FEATURE} -- failed to compile")
    else()
      message("-- Performing Test ${FEATURE} -- compiled but failed to run")
    endif()
  endif()
endfunction()

# - Compile and run code to check for C++ features
#
# This functions compiles a source file under the `cmake` folder
# and adds the corresponding `HAVE_[FILENAME]` flag to the CMake
# environment
#
#  cxx_feature_check(<FLAG> [<VARIANT>])
#
# - Example
#
# include(CXXFeatureCheck)
# cxx_feature_check(STD_REGEX)
# Requires CMake 2.6+

if(__cxx_feature_check)
  return()
endif()
set(__cxx_feature_check INCLUDED)

function(cxx_feature_check FILE)
  string(TOLOWER ${FILE} FILE)
  string(TOUPPER ${FILE} VAR)
  string(TOUPPER "HAVE_${VAR}" FEATURE)
  message("-- Performing Test ${FEATURE}")
  try_run(RUN_${FEATURE} COMPILE_${FEATURE}
          ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp)
  if(RUN_${FEATURE} EQUAL 0 OR (COMPILE_${FEATURE} AND CROSS_COMPILING))
    message("-- Performing Test ${FEATURE} -- success")
    set(HAVE_${VAR} 1 PARENT_SCOPE)
    add_definitions(-DHAVE_${VAR})
  else()
    if(NOT COMPILE_${FEATURE})
      message("-- Performing Test ${FEATURE} -- failed to compile")
    else()
      message("-- Performing Test ${FEATURE} -- compiled but failed to run")
    endif()
  endif()
endfunction()

Add support for explicitly cross compiling.


set(DOCUMENTATION "This module contains the third party GDCM library.
Grassroots DiCoM is a C++ library for DICOM medical files.")

itk_module(ITKGDCM
  DEPENDS
    ITKZLIB
    ITKExpat
    ITKOpenJPEG
  DESCRIPTION
    "${DOCUMENTATION}"
)

set(DOCUMENTATION "This module contains the third party GDCM library.
Grassroots DiCoM is a C++ library for DICOM medical files.")

if(ITK_USE_SYSTEM_GDCM)
  itk_module(ITKGDCM
    DESCRIPTION
      "${DOCUMENTATION}"
    EXCLUDE_FROM_ALL
    )
else()
  itk_module(ITKGDCM
    DEPENDS
      ITKZLIB
      ITKExpat
      ITKOpenJPEG
    DESCRIPTION
      "${DOCUMENTATION}"
  )
endif()

ENH: Exclude ITKGDCM module when system GDCM is ON.

When ITK_USE_SYSTEM_GDCM is set to be ON,ITKGDCM module
should be excluded from building.


# - Find Openldap
# This module defines
#  LDAP_INCLUDE_DIR, where to find LDAP headers
#  LDAP_STATIC_LIBRARY, the LDAP library to use.
#  LBER_STATIC_LIBRARY, a support library for LDAP.
#  LDAP_FOUND, If false, do not try to use.

set(THIRDPARTY_LDAP thirdparty/openldap-$ENV{IMPALA_OPENLDAP_VERSION})

set (THIRDPARTY ${CMAKE_SOURCE_DIR}/thirdparty)
set(LDAP_SEARCH_LIB_PATH
  ${THIRDPARTY}/openldap-$ENV{IMPALA_OPENLDAP_VERSION}/impala_install/lib
)

set(LDAP_INCLUDE_DIR
  ${THIRDPARTY_LDAP}/install/include
)

find_library(LDAP_LIB_PATH NAMES ldap
  PATHS ${LDAP_SEARCH_LIB_PATH}
        NO_DEFAULT_PATH
        DOC   "Openldap library"
)

if (LDAP_LIB_PATH)
  set(LDAP_FOUND TRUE)
  set(LDAP_STATIC_LIBRARY ${LDAP_SEARCH_LIB_PATH}/libldap.a)
  SET(LBER_STATIC_LIBRARY ${LDAP_SEARCH_LIB_PATH}/liblber.a)
else ()
  set(LDAP_FOUND FALSE)
endif ()

if (LDAP_FOUND)
  if (NOT LDAP_FIND_QUIETLY)
    message(STATUS "Found LDAP ${LDAP_STATIC_LIBRARY}")
  endif ()
else ()
  message(STATUS "LDAP includes and libraries NOT found.")
endif ()

mark_as_advanced(
  LDAP_STATIC_LIBRARY
  LDAP_INCLUDE_DIR
)

# - Find Openldap
# This module defines
#  LDAP_INCLUDE_DIR, where to find LDAP headers
#  LDAP_STATIC_LIBRARY, the LDAP library to use.
#  LBER_STATIC_LIBRARY, a support library for LDAP.
#  LDAP_FOUND, If false, do not try to use.

set(THIRDPARTY_LDAP thirdparty/openldap-$ENV{IMPALA_OPENLDAP_VERSION})

set (THIRDPARTY ${CMAKE_SOURCE_DIR}/thirdparty)
set(LDAP_SEARCH_LIB_PATH
  ${THIRDPARTY}/openldap-$ENV{IMPALA_OPENLDAP_VERSION}/impala_install/lib
)

set(LDAP_INCLUDE_DIR
  ${THIRDPARTY_LDAP}/impala_install/include
)

find_library(LDAP_LIB_PATH NAMES ldap
  PATHS ${LDAP_SEARCH_LIB_PATH}
        NO_DEFAULT_PATH
        DOC   "Openldap library"
)

if (LDAP_LIB_PATH)
  set(LDAP_FOUND TRUE)
  set(LDAP_STATIC_LIBRARY ${LDAP_SEARCH_LIB_PATH}/libldap.a)
  SET(LBER_STATIC_LIBRARY ${LDAP_SEARCH_LIB_PATH}/liblber.a)
else ()
  set(LDAP_FOUND FALSE)
endif ()

if (LDAP_FOUND)
  if (NOT LDAP_FIND_QUIETLY)
    message(STATUS "Found LDAP ${LDAP_STATIC_LIBRARY}")
  endif ()
else ()
  message(STATUS "LDAP includes and libraries NOT found.")
endif ()

mark_as_advanced(
  LDAP_STATIC_LIBRARY
  LDAP_INCLUDE_DIR
)

Fix Ldap include path in cmake find module.

Change-Id: I877475e7f2b4888a712c3aef5bd207e35046afb1
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3865
Reviewed-by: Nong Li <99a5e5f8f5911755b88e0b536d46aafa102bed41@cloudera.com>
Reviewed-by: Alex Behm <fe1626037acfc2dc542d2aa723a6d14f2464a20c@cloudera.com>
Tested-by: Alex Behm <fe1626037acfc2dc542d2aa723a6d14f2464a20c@cloudera.com>


# Arguments:
#  PREFIX    - Installation prefix
#  COMPONENTS - Installation component

set(COMPONENTS ${COMPONENTS})
foreach(component ${COMPONENTS})
  execute_process(
    COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${PREFIX}
                             -DCMAKE_INSTALL_COMPONENT=${component}
                             -P cmake_install.cmake
    RESULT_VARIABLE result
    OUTPUT_QUIET
  )

  if(result)
    set(msg "Local installation of ${component} failed: ${result}\n")
    message(FATAL_ERROR "${msg}")
  endif()
endforeach()

# Arguments:
#  PREFIX    - Installation prefix
#  COMPONENTS - Installation component

set(COMPONENTS ${COMPONENTS})
set(ENV{DESTDIR} "")
foreach(component ${COMPONENTS})
  execute_process(
    COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${PREFIX}
                             -DCMAKE_INSTALL_COMPONENT=${component}
                             -P cmake_install.cmake
    RESULT_VARIABLE result
    OUTPUT_QUIET
  )

  if(result)
    set(msg "Local installation of ${component} failed: ${result}\n")
    message(FATAL_ERROR "${msg}")
  endif()
endforeach()

Disable DESTDIR when moving the headers in the build area (fixes ROOT-6803)


set(CMAKE_MODULE_PATH @CMAKE_MODULE_PATH@) # fetch top level CMAKE_MODULE_PATH

message(">:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>: ${CMAKE_MODULE_PATH} <:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:")

# possibly import these via CMakeLists.txt: i.e., @is_ios@, etc
string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" is_ios)
string(COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "Linux" is_linux)

### OpenCV
# Note: This will be more complicated for the final release
if(is_ios)
   set(OPENCV_CMAKE_ARGS BUILD_SHARED_LIBS=OFF WITH_FFMPEG=OFF) #TBD
elseif(APPLE)
   include(SetOpenCVCMakeArgs-osx) # shorten long list
   set_opencv_cmake_args_osx()
elseif(is_linux)
   set(OPENCV_CMAKE_ARGS BUILD_SHARED_LIBS=OFF WITH_FFMPEG=OFF) #TBD
elseif(MSCV)
   set(OPENCV_CMAKE_ARGS BUILD_SHARED_LIBS=OFF WITH_FFMPEG=OFF) #TBD
elseif(ANDROID)
   set(OPENCV_CMAKE_ARGS BUILD_SHARED_LIBS=OFF WITH_FFMPEG=OFF) #TBD
endif()

hunter_config(OpenCV VERSION ${HUNTER_OpenCV_VERSION} CMAKE_ARGS "${OPENCV_CMAKE_ARGS}")

list(APPEND CMAKE_MODULE_PATH @CMAKE_MODULE_PATH@) # fetch top level CMAKE_MODULE_PATH

message(">:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>: ${CMAKE_MODULE_PATH} <:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:")

# possibly import these via CMakeLists.txt: i.e., @is_ios@, etc
string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" is_ios)
string(COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "Linux" is_linux)

### OpenCV
# Note: This will be more complicated for the final release
if(is_ios)
   set(OPENCV_CMAKE_ARGS BUILD_SHARED_LIBS=OFF WITH_FFMPEG=OFF) #TBD
elseif(APPLE)
   include(SetOpenCVCMakeArgs-osx) # shorten long list
   set_opencv_cmake_args_osx()
elseif(is_linux)
   set(OPENCV_CMAKE_ARGS BUILD_SHARED_LIBS=OFF WITH_FFMPEG=OFF) #TBD
elseif(MSCV)
   set(OPENCV_CMAKE_ARGS BUILD_SHARED_LIBS=OFF WITH_FFMPEG=OFF) #TBD
elseif(ANDROID)
   set(OPENCV_CMAKE_ARGS BUILD_SHARED_LIBS=OFF WITH_FFMPEG=OFF) #TBD
endif()

hunter_config(OpenCV VERSION ${HUNTER_OpenCV_VERSION} CMAKE_ARGS "${OPENCV_CMAKE_ARGS}")

Use `list(APPEND` instead of `set`

Use `list(APPEND` instead of `set`


## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation                                    ##
##                                                                          ##
## 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.                                           ##
## ======================================================================== ##

set(CTEST_PROJECT_NAME "Embree")
set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
set(TEST_MODELS_HASH d113ca812525c61676e98c240c02ef6899306fa2)

## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation                                    ##
##                                                                          ##
## 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.                                           ##
## ======================================================================== ##

set(CTEST_PROJECT_NAME "Embree")
set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
set(TEST_MODELS_HASH fa148f9c3dd78ebd821cb45f60d9872bf4f30cd6)

Update models hash for multi instanced geometry.


set(CTEST_PROJECT_NAME_SUPERBUILD "MITK-superbuild")
set(CTEST_PROJECT_NAME "MITK")
set(CTEST_NIGHTLY_START_TIME "23:00:00 EDT")

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

set(CTEST_PROJECT_NAME_SUPERBUILD "MITK-superbuild")
set(CTEST_PROJECT_NAME "MITK")
set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")

set(CTEST_SUBMIT_URL "https://cdash.mitk.org/submit.php?project=MITK")

Migrate CDash drop site / submission URL


#---------------------------------------------------------------------------
# Get and build vtk

if(NOT VTK_TAG)
  set(VTK_TAG "v8.2.0")
endif()

set(PYTHON_EXECUTABLE "${ITKPYTHON_EXECUTABLE}")

ExternalProject_Add(VTK
  GIT_REPOSITORY "${git_protocol}://vtk.org/VTK.git"
  GIT_TAG "${VTK_TAG}"
  SOURCE_DIR VTK
  BINARY_DIR VTK-build
  CMAKE_GENERATOR ${gen}
  CMAKE_ARGS
    ${ep_common_args}
    ${_wrap_python_args}
    -DBUILD_SHARED_LIBS:BOOL=ON
    -DBUILD_EXAMPLES:BOOL=OFF
    -DBUILD_TESTING:BOOL=OFF
    -DVTK_Group_Web:BOOL=ON
    -DModule_vtkImagingMath:BOOL=ON
    -DVTK_WRAP_PYTHON:BOOL=ON
    -DExternalData_OBJECT_STORES:STRING=${ExternalData_OBJECT_STORES}
    "-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
    -DVTK_USE_SYSTEM_ZLIB:BOOL=ON
    "-DZLIB_ROOT:PATH=${ZLIB_ROOT}"
    "-DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR}"
    "-DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY}"
  INSTALL_COMMAND ""
  LOG_DOWNLOAD 0
  LOG_UPDATE 0
  DEPENDS zlib
)

set(VTK_DIR ${CMAKE_BINARY_DIR}/VTK-build)

#---------------------------------------------------------------------------
# Get and build vtk

if(NOT VTK_TAG)
  set(VTK_TAG "v8.2.0")
endif()

set(PYTHON_EXECUTABLE "${ITKPYTHON_EXECUTABLE}")

ExternalProject_Add(VTK
  GIT_REPOSITORY "https://gitlab.kitware.com/VTK/VTK.git"
  GIT_TAG "${VTK_TAG}"
  SOURCE_DIR VTK
  BINARY_DIR VTK-build
  CMAKE_GENERATOR ${gen}
  CMAKE_ARGS
    ${ep_common_args}
    ${_wrap_python_args}
    -DBUILD_SHARED_LIBS:BOOL=ON
    -DBUILD_EXAMPLES:BOOL=OFF
    -DBUILD_TESTING:BOOL=OFF
    -DVTK_Group_Web:BOOL=ON
    -DModule_vtkImagingMath:BOOL=ON
    -DVTK_WRAP_PYTHON:BOOL=ON
    -DExternalData_OBJECT_STORES:STRING=${ExternalData_OBJECT_STORES}
    "-DPython3_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
    -DVTK_USE_SYSTEM_ZLIB:BOOL=ON
    "-DZLIB_ROOT:PATH=${ZLIB_ROOT}"
    "-DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR}"
    "-DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY}"
  INSTALL_COMMAND ""
  LOG_DOWNLOAD 0
  LOG_UPDATE 0
  DEPENDS zlib
)

set(VTK_DIR ${CMAKE_BINARY_DIR}/VTK-build)

Update VTK Git clone URL

BUG: Update VTK Git clone URL

The old URL, git protocol, is no longer supported.


# Copyright (c) 2015, Ruslan Baratov, David Hirvonen
# All rights reserved.

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

include(hunter_add_version)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
    PACKAGE_NAME
    half
    VERSION
	"1.1.0-p0"
    URL
	"https://github.com/headupinclouds/half/archive/v1.1.0-p0.tar.gz"
    SHA1
	ad46279b4baf5e819881e66303bb20f88d6df916
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_download(PACKAGE_NAME half)

Remove tabs and trailing whitespaces

Remove tabs and trailing whitespaces


set(DOCUMENTATION "This module implements Anisotropic Diffusion, using Lattice Basis Reduction.")

# itk_module() defines the module dependencies in ITKAnisotropicFastMarchingLBR;
# ITKAnisotropicFastMarchingLBR depends on ITKCommon;
# The testing module in ITKExternalTemplate depends on ITKTestKernel,
# and ITKMetaIO for image IO (besides ITKAnisotropicDiffusionLBR itself)

itk_module(ITKAnisotropicDiffusionLBR
  DEPENDS
    ITKCommon
    ITKIOImageBase
    ITKIOSpatialObjects
    ITKMetaIO
    ITKImageGradient
  TEST_DEPENDS
    ITKTestKernel
  EXCLUDE_FROM_DEFAULT
  DESCRIPTION
    "${DOCUMENTATION}"
)

set(DOCUMENTATION "This module implements Anisotropic Diffusion, using Lattice Basis Reduction.

Documentation can be found in the Insight Journal article, 'Anisotropic
Diffusion in ITK', by Mirebeau J., Fehrenbach J., Risser L., Tobji S.

http://insight-journal.org/browse/publication/953
http://hdl.handle.net/10380/3505
")

# itk_module() defines the module dependencies in ITKAnisotropicFastMarchingLBR;
# ITKAnisotropicFastMarchingLBR depends on ITKCommon;
# The testing module in ITKExternalTemplate depends on ITKTestKernel,
# and ITKMetaIO for image IO (besides ITKAnisotropicDiffusionLBR itself)

itk_module(ITKAnisotropicDiffusionLBR
  DEPENDS
    ITKCommon
    ITKIOImageBase
    ITKIOSpatialObjects
    ITKMetaIO
    ITKImageGradient
  TEST_DEPENDS
    ITKTestKernel
  EXCLUDE_FROM_DEFAULT
  DESCRIPTION
    "${DOCUMENTATION}"
)

DOC: Add link to the IJ article in the module documentation.


SET (CMAKE_C_COMPILER "clang")
SET (CMAKE_CXX_COMPILER "clang++")

SET(CMAKE_C_FLAGS "-pipe -Wall -Wextra -pedantic -std=c99" CACHE STRING "" FORCE)

SET(CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer" CACHE STRING "" FORCE)
SET(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb" CACHE STRING "" FORCE)

IF(NOT CMAKE_BUILD_TYPE )
  SET(CMAKE_BUILD_TYPE RELEASE CACHE STRING "" FORCE )
ENDIF()

SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-O2 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--gc-sections" CACHE STRING "" FORCE)

MESSAGE (STATUS "Found CLANG toolchain")

SET (CMAKE_C_COMPILER "clang")
SET (CMAKE_CXX_COMPILER "clang++")

SET(CMAKE_C_FLAGS "-pipe -Wall -Wextra -Wfloat-equal -Wformat=2 -Wimplicit-atomic-properties -Wmissing-declarations -Wmissing-prototypes -Woverlength-strings -Wshadow -Wstrict-selector-match -Wundeclared-selector -Wunreachable-code -pedantic -std=c99" CACHE STRING "" FORCE)

SET(CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer" CACHE STRING "" FORCE)
SET(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb" CACHE STRING "" FORCE)

IF(NOT CMAKE_BUILD_TYPE )
  SET(CMAKE_BUILD_TYPE RELEASE CACHE STRING "" FORCE )
ENDIF()

SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-O2 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--gc-sections" CACHE STRING "" FORCE)

MESSAGE (STATUS "Found CLANG toolchain")

Add lots of warning switches.

Add lots of warning switches.


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

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

ENH: Update SCIFIO to latest revision (2017.01.17)

Francois Budin (4):
      BUG: Remove CMAKE_INSTALL_PREFIX from install directory
      ENH: Improve usage of JAVA_HOME and SCIFIO_PATH environment variables
      ENH: Uses https instead of http to download jre and *.jars
      ENH: Remove extra slash (or backslash) in paths to facilitate concatenation

Matt McCormick (3):
      Merge pull request #31 from fbudin69500/remove_CMAKE_INSTALL_PREFIX
      Merge pull request #32 from fbudin69500/ENH_Uses_https_to_download_jre_and_jars
      Merge pull request #33 from fbudin69500/Improve_Path_handling

Change-Id: I407603553947c5c88e0c29b6db4f3990217b6936


MACRO(SIGN_TARGET target)
  IF(WITH_SIGNCODE)
    IF(WIN32)
      SET(target_file $<TARGET_FILE:${target}>)
      IF(EXISTS "C:\tools\sign.bat")
        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND c:\tools\sign.bat ${target_file})
      ELSEIF()
        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND signtool ARGS sign ${SIGN_OPTIONS} ${target_file})
      ENDIF()
    ENDIF()
  ENDIF()
ENDMACRO()

MACRO(SIGN_TARGET target)
  IF(WITH_SIGNCODE)
    IF(WIN32)
      SET(target_file $<TARGET_FILE:${target}>)
      IF(EXISTS "/tools/sign.bat")
        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND /tools/sign.bat ARGS ${target_file})
      ELSEIF()
        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND signtool ARGS sign ${SIGN_OPTIONS} ${target_file})
      ENDIF()
    ENDIF()
  ENDIF()
ENDMACRO()

Fix for windows build: cmake doesn't like backslashes :-(


MACRO (MYPACKAGEEXPORT)

  IF (MYPACKAGE_DEBUG)
    MESSAGE (STATUS "[${PROJECT_NAME}-EXPORT-DEBUG] Creating target ${PROJECT_NAME}Export with export file ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
  ENDIF ()
  INCLUDE (GenerateExportHeader)
  GENERATE_EXPORT_HEADER(${PROJECT_NAME}
    BASE_NAME ${PROJECT_NAME}
    EXPORT_MACRO_NAME ${PROJECT_NAME}_EXPORT
    EXPORT_FILE_NAME "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h"
    STATIC_DEFINE ${PROJECT_NAME}_STATIC)
  ADD_CUSTOM_TARGET(${PROJECT_NAME}Export SOURCES "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
  INSTALL(FILES ${_file} DESTINATION ${_dir})
  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION ${PROJECT_NAME})

ENDMACRO()

MACRO (MYPACKAGEEXPORT)

  IF (MYPACKAGE_DEBUG)
    MESSAGE (STATUS "[${PROJECT_NAME}-EXPORT-DEBUG] Creating target ${PROJECT_NAME}Export with export file ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
  ENDIF ()
  INCLUDE (GenerateExportHeader)
  GENERATE_EXPORT_HEADER(${PROJECT_NAME}
    BASE_NAME ${PROJECT_NAME}
    EXPORT_MACRO_NAME ${PROJECT_NAME}_EXPORT
    EXPORT_FILE_NAME "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h"
    STATIC_DEFINE ${PROJECT_NAME}_STATIC)
  ADD_CUSTOM_TARGET(${PROJECT_NAME}Export SOURCES "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
  INSTALL(FILES ${_file} DESTINATION ${_dir})
  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION include/${PROJECT_NAME}/)

ENDMACRO()

Install of export file bis

Install of export file bis


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

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

# "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 "5b4675066b28847d2ffc59f9117263df3fa55fcb")

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

Update FW: allow `StereoDepth` to work with `ColorCamera`s, without having to call `StereoDepth::setInputResolution`


include_guard()

add_custom_target(
    format
    COMMAND find src tests -type f '\(' -iname *.h -o -iname *.hpp -o -iname *.c -o -iname *.cpp '\)' | xargs clang-format -style=file -i
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)

include_guard()

set(FORMAT_SCRIPT ${CMAKE_SOURCE_DIR}/scripts/format_code)

add_custom_target(
    format
    COMMAND ${FORMAT_SCRIPT} "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/tests"
    VERBATIM
)

Use format_code script in cmake 'format' target


message(STATUS "Fixing relative dependencies")

file(GLOB boost_dylibs ./libboost*.dylib)

foreach(in ${boost_dylibs})
  foreach(other_boost_dylib ${boost_dylibs})
    get_filename_component(from ${other_boost_dylib} NAME)
    set(to "@rpath/${from}")
    execute_process(COMMAND install_name_tool -change ${from} ${to} ${in})
  endforeach()
endforeach()

message(STATUS "Make Boost libraries use RPATH")

file(GLOB boost_dylibs ./libboost*.dylib)

foreach(boost_dylib ${boost_dylibs})
  get_filename_component(boost_dylib ${boost_dylib} NAME)
  execute_process(COMMAND install_name_tool -id @rpath/${boost_dylib} ${boost_dylib})
endforeach()

Make Boost libraries use RPATH

Make Boost libraries use RPATH


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

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

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

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

Update FW: add OV9282 Strobe output

Update FW: add OV9282 Strobe output


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

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

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

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

Update FW with subpixel fix

Update FW with subpixel fix


set(DOCUMENTATION "This module contains the classes for the input and output
of itkTransform object in MINC format (.xfm).")

itk_module(ITKIOTransformMINC
  DEPENDS
    ITKIOTransformBase
    ITKMINC
  PRIVATE_DEPENDS
    ITKIOMINC
  TEST_DEPENDS
    ITKTestKernel
    ITKDisplacementField
  DESCRIPTION
    "${DOCUMENTATION}"
  EXCLUDE_FROM_DEFAULT
)

set(DOCUMENTATION "This module contains the classes for the input and output
of itkTransform object in MINC format (.xfm).")

itk_module(ITKIOTransformMINC
  DEPENDS
    ITKIOTransformBase
    ITKMINC
  COMPILE_DEPENDS
    ITKIOImageBase
  PRIVATE_DEPENDS
    ITKIOMINC
  TEST_DEPENDS
    ITKTestKernel
    ITKDisplacementField
  DESCRIPTION
    "${DOCUMENTATION}"
  EXCLUDE_FROM_DEFAULT
)

COMP: Add missing ITKIOImageBase dependency for ITKTransformMINC.

This addresses:

In file included from /home/matt/src/ITK/Modules/IO/TransformMINC/include/itkMINCTransformIO.hxx:27:0,
                 from /home/matt/src/ITK/Modules/IO/TransformMINC/include/itkMINCTransformIO.h:100,
                 from /home/matt/src/ITK/Modules/IO/TransformMINC/src/itkMINCTransformIOFactory.cxx:21:
/home/matt/src/ITK/Modules/IO/MINC/include/itkMINCImageIO.h:30:28: fatal error: itkImageIOBase.h: No such file or directory
 #include "itkImageIOBase.h"

Change-Id: Idb99a44e839dd5abd0f77e32530498e1d56ddef3


# VTK version number components.
set(VTK_MAJOR_VERSION 6)
set(VTK_MINOR_VERSION 1)
set(VTK_BUILD_VERSION 0)

# VTK version number components.
set(VTK_MAJOR_VERSION 6)
set(VTK_MINOR_VERSION 2)
set(VTK_BUILD_VERSION 0)

Increment version to VTK 6.2.0

Increment version to VTK 6.2.0

Change-Id: I4f02cc6c833410b89021bdf1461f475a0db556bf


include(CMakeForceCompiler)

set (CROSSCOMPILE_TARGET_NAME "IMX")

set (CMAKE_SYSTEM_NAME "Linux")
set (CMAKE_SYSROOT ${ROOTFS_PATH})
set (PLAFTFORM_MODULES "IMX_MODULES")
set (CROSS_COMPILE "ON")

# Setup the cross compiling tools
set (TOOLCHAIN_BIN "${TOOLCHAIN_PATH}/bin")
set (CMAKE_C_COMPILER ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-gcc)
set (CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-g++)
set (CMAKE_AR "${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ar" CACHE PATH "archive" FORCE)
set (CMAKE_LINKER "${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ld" CACHE PATH "linker" FORCE)
set (CMAKE_RANLIB "${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ranlib" CACHE PATH "ranlib" FORCE)

# Setup the paths used by find_* functions
set (CMAKE_LIBRARY_PATH "${ROOTFS_PATH}/lib")
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH "${ROOTFS_PATH}/lib")

add_definitions (-D__linux -D_UINTPTR_T)

include(CMakeForceCompiler)

set (CROSSCOMPILE_TARGET_NAME "IMX")

set (CMAKE_SYSTEM_NAME "Linux")
set (CMAKE_SYSROOT ${SYSROOT_PATH})
set (PLAFTFORM_MODULES "IMX_MODULES")
set (CROSS_COMPILE "ON")

# Setup the cross compiling tools
set (TOOLCHAIN_BIN "${TOOLCHAIN_PATH}/bin")
set (CMAKE_C_COMPILER ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-gcc)
set (CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-g++)
set (CMAKE_AR "${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ar" CACHE PATH "archive" FORCE)
set (CMAKE_LINKER "${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ld" CACHE PATH "linker" FORCE)
set (CMAKE_RANLIB "${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ranlib" CACHE PATH "ranlib" FORCE)

# Setup the paths used by find_* functions
set (CMAKE_LIBRARY_PATH "${ROOTFS_PATH}/lib")
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH "${ROOTFS_PATH}/lib")

add_definitions (-D__linux -D_UINTPTR_T)

Change env var from ROOTFS to SYSROOT

Change env var from ROOTFS to SYSROOT

Change-Id: I54405cfac4caccab74b95f23303eb66ce2a7dc93


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


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})

INCLUDE(ExternalProject)

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

ExternalProject_Add(
    cl2hpp-ext
    GIT_REPOSITORY https://github.com/KhronosGroup/OpenCL-CLHPP.git
    GIT_TAG 75bb7d0d8b2ffc6aac0a3dcaa22f6622cab81f7c
    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 url to KhronosGroup Repository


//===-- Config.h -----------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_HOST_CONFIG_H
#define LLDB_HOST_CONFIG_H

#cmakedefine01 LLDB_CONFIG_TERMIOS_SUPPORTED

#cmakedefine LLDB_DISABLE_POSIX

#cmakedefine01 HAVE_SYS_EVENT_H

#endif // #ifndef LLDB_HOST_CONFIG_H

//===-- Config.h -----------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_HOST_CONFIG_H
#define LLDB_HOST_CONFIG_H

#cmakedefine LLDB_CONFIG_TERMIOS_SUPPORTED

#cmakedefine LLDB_DISABLE_POSIX

#cmakedefine01 HAVE_SYS_EVENT_H

#endif // #ifndef LLDB_HOST_CONFIG_H

Fix bot breakage from r300372

Fix bot breakage from r300372

Use #cmakedefine instead of #cmakedefine01 because the uses are ifndef instead of if.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@300374 91177308-0d34-0410-b5e6-96231b3b80d8


INCLUDE(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_CXX11_STANDARD_COMPILE_OPTION})

CHECK_CXX_SOURCE_COMPILES(
    "#include <cstdint>

    template <typename T> void Foo();
    template<> void Foo<int32_t>() {}
    template<> void Foo<int64_t>() {}
    int main(int argc, char** argv) {
      Foo<long>();
      return 0;
    }" CAFFE2_LONG_IS_INT32_OR_64)

if (CAFFE2_LONG_IS_INT32_OR_64)
  message(STATUS "Does not need to define long separately.")
else()
  message(STATUS "Need to define long as a separate typeid.")
  add_definitions(-DCAFFE2_UNIQUE_LONG_TYPEMETA)
endif()

INCLUDE(CheckCXXSourceCompiles)

set(CMAKE_REQUIRED_FLAGS "-std=c++11")

CHECK_CXX_SOURCE_COMPILES(
    "#include <cstdint>

    template <typename T> void Foo();
    template<> void Foo<int32_t>() {}
    template<> void Foo<int64_t>() {}
    int main(int argc, char** argv) {
      Foo<long>();
      return 0;
    }" CAFFE2_LONG_IS_INT32_OR_64)

if (CAFFE2_LONG_IS_INT32_OR_64)
  message(STATUS "Does not need to define long separately.")
else()
  message(STATUS "Need to define long as a separate typeid.")
  add_definitions(-DCAFFE2_UNIQUE_LONG_TYPEMETA)
endif()

Move c++11 check to cmake 2.8

Move c++11 check to cmake 2.8

Previous check required cmake >= 3.1


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

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

# "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 "4549a0e785f7e3a5d79481c05112e5f78ceb5e4e")

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

Update FW: improve image resize mechanism (less cropping), for ColorCamera `preview` output and ImageManip setResize


include(CheckLibraryExists)
include(CheckStructHasMember)

# Check which versions of TLS the OpenSSL/ssl library supports
check_library_exists(${OPENSSL_SSL_LIBRARY} "TLSv1_1_method" "" HAVE_TLS_V1_1)
check_library_exists(${OPENSSL_SSL_LIBRARY} "TLSv1_2_method" "" HAVE_TLS_V1_2)

check_struct_has_member ("SSL_CIPHER" algorithm_enc openssl/ssl.h HAVE_SSL_CIPHER_SPLIT_ALGORITHMS)

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

include(CheckLibraryExists)
include(CheckStructHasMember)

set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})

# Check which versions of TLS the OpenSSL/ssl library supports
check_library_exists(${OPENSSL_SSL_LIBRARY} "TLSv1_1_method" "" HAVE_TLS_V1_1)
check_library_exists(${OPENSSL_SSL_LIBRARY} "TLSv1_2_method" "" HAVE_TLS_V1_2)

check_struct_has_member ("SSL_CIPHER" algorithm_enc openssl/ssl.h HAVE_SSL_CIPHER_SPLIT_ALGORITHMS)

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

Improve support for `brew install openssl` on OSX

The test for algorithm_enc vs algorithms was using only the default includes path. Now it
also includes the place where find_package found the openssl headers, so the test executes
successfully, leading to a successful compilation.


# QT4_GENERATE_MOCS(inputfile1 [inputfile2 ...])

macro(QT4_GENERATE_MOCS)
  foreach(file ${ARGN})
    set(moc_file moc_${file})
    QT4_GENERATE_MOC(${file} ${moc_file})

    get_filename_component(source_name ${file} NAME_WE)
    get_filename_component(source_ext ${file} EXT)
    if(${source_ext} MATCHES "\\.[hH]")
      if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${source_name}.cpp)
        set(source_ext .cpp)
      elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${source_name}.cxx)
        set(source_ext .cxx)
      endif()
    endif()
    set_property(SOURCE ${source_name}${source_ext} APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${moc_file})
  endforeach()
endmacro()

# QT4_GENERATE_MOCS(inputfile1 [inputfile2 ...])

macro(QT4_GENERATE_MOCS)
  QT4_GET_MOC_FLAGS(_moc_flags)

  foreach(file ${ARGN})
    set(moc_file moc_${file})

    get_filename_component(source_name ${file} NAME_WE)
    get_filename_component(source_ext ${file} EXT)
    if(${source_ext} MATCHES "\\.[hH]")
      if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${source_name}.cpp)
        set(source_ext .cpp)
      elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${source_name}.cxx)
        set(source_ext .cxx)
      endif()
    endif()

    set(_cpp ${source_name}${source_ext})
    set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${moc_file})

    QT4_CREATE_MOC_COMMAND(${_cpp} ${_moc} "${_moc_flags}" "")
    MACRO_ADD_FILE_DEPENDENCIES(${_cpp} ${_moc})

  endforeach()
endmacro()

Optimize QT4_GENERATE_MOCS macro getting moc flags only when needed

See #449


## Tbag CMake subproject.
tbag_modules__include_project (Default)

# Extension.
tbag_modules__include_project (GTest)
tbag_modules__include_project (UV)
tbag_modules__include_project (TinyXML2)
tbag_modules__include_project (Spdlog)
tbag_modules__include_project (SQlite3)

#tbag_modules__include_project (Preview)

## Tbag CMake subproject.
tbag_modules__include_project (Default)

# Extension.
tbag_modules__include_project (GTest)
tbag_modules__include_project (UV)
tbag_modules__include_project (TinyXML2)
tbag_modules__include_project (Spdlog)
tbag_modules__include_project (SQLite3)

#tbag_modules__include_project (Preview)

Fix the compile error: include could not find load file TbagProjectSQlite3.


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

set(_fft_depends ITKFFT)
if(ITKUltrasound_USE_clFFT)
  list(APPEND _fft_depends ITKGPUCommon)
endif()

itk_module(Ultrasound
  DEPENDS
    ITKAnisotropicSmoothing
    ITKImageCompose
    ITKImageFunction
    ITKImageIntensity
    ITKIOImageBase
    ITKTransform
    ITKRegistrationCommon
    ${_fft_depends}
  COMPILE_DEPENDS
    SplitComponents
    BSplineGradient
    HigherOrderAccurateGradient
    Strain
  PRIVATE_DEPENDS
    ITKHDF5
    ITKTestKernel
    ITKImageSources
    ITKEigen3
  TEST_DEPENDS
    ITKVideoCore
    ITKVideoIO
  EXCLUDE_FROM_DEFAULT
  ENABLE_SHARED
  DESCRIPTION
    "${DOCUMENTATION}"
  )

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

set(_fft_depends ITKFFT)
if(ITKUltrasound_USE_clFFT)
  list(APPEND _fft_depends ITKGPUCommon)
endif()

itk_module(Ultrasound
  DEPENDS
    ITKAnisotropicSmoothing
    ITKImageCompose
    ITKImageFunction
    ITKImageIntensity
    ITKIOImageBase
    ITKTransform
    ITKRegistrationCommon
    ${_fft_depends}
  COMPILE_DEPENDS
    SplitComponents
    BSplineGradient
    HigherOrderAccurateGradient
    Strain
  PRIVATE_DEPENDS
    ITKHDF5
    ITKImageSources
    ITKEigen3
  TEST_DEPENDS
    ITKTestKernel
    ITKVideoCore
    ITKVideoIO
  EXCLUDE_FROM_DEFAULT
  ENABLE_SHARED
  DESCRIPTION
    "${DOCUMENTATION}"
  )

Make ITKTestKernel a test dependency

BUG: Make ITKTestKernel a test dependency

When ITK is compiled with the ITKUltrasound remote module with testing
enabled (e.g. -DModule_Ultrasound=ON -DBUILD_TESTING=ON) the Ultrasound
test driver previously failed to find the itkTestingMacros.h header.

With this change ITKTestKernel is now a test dependency so that the test
driver can be built appropriately when "test/" is not built as a
subdirectory of the root Ultrasound directory.


# this one is important
SET (CMAKE_SYSTEM_NAME Linux)
# this one not so much
SET (CMAKE_SYSTEM_VERSION 1)

# Check for Raspberry Pi Tools and bail out if they don't have it
if(DEFINED ENV{PI_TOOLS_HOME} AND DEFINED ENV{PI_TOOL})
  message("Using Raspberry Pi Tools found in $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL}")
else()
  message("PI_TOOLS_HOME or PI_TOOL is not set; You must tell CMake where to find Raspberry Pi Tools (cross-compiler)")
  return()
endif()

# specify the cross compiler
SET (CMAKE_C_COMPILER $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL}/bin/arm-linux-gnueabihf-gcc)
SET (CMAKE_CXX_COMPILER $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL}/bin/arm-linux-gnueabihf-g++)

# where is the target environment
SET (CMAKE_FIND_ROOT_PATH $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL} $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL}/include)

# search for programs in the build host directories
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Add carriage return at the end of the file.


# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

include("${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake")

# Disable -fno-freestanding.
set_compiler_property(PROPERTY hosted)

check_set_compiler_property(APPEND PROPERTY warning_extended -Wunused-variable
	-Werror=unused-variable -Werror=missing-braces
	-Werror=sometimes-uninitialized)

# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

include("${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake")

# Disable -fno-freestanding.
set_compiler_property(PROPERTY hosted)

check_set_compiler_property(APPEND PROPERTY warning_extended -Wunused-variable
	-Werror=unused-variable -Werror=missing-braces
	-Werror=sometimes-uninitialized -Werror=unused-function
	-Werror=array-bounds)

Add more compiler warnings as errors

zephyr: Add more compiler warnings as errors

Added unused-function and array-bounds, this should help prevent gitlab
failures.

BRANCH=None
BUG=None
TEST=zmake testall

Change-Id: Iebeaa8fc64990c844e43daf8b979c7f243a93bcc
Signed-off-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3340212
Reviewed-by: Yuval Peress <50dc11c009bd4d7e9d9d15a383c1743ce5ee82ef@google.com>
Commit-Queue: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Tested-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>


# Contact: Arnaud Gelas <arnaudgelas@gmail.com>
itk_fetch_module(MinimalPathExtraction
 "http://www.insight-journal.org/browse/publication/213
"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction.git
  GIT_TAG c00dbb883a44db59004210840d6c3f9deebaf92c
  )

# Contact: Arnaud Gelas <arnaudgelas@gmail.com>
itk_fetch_module(MinimalPathExtraction
 "http://www.insight-journal.org/browse/publication/213
"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction.git
  GIT_TAG 322e9338d76b7dcfb98861c6c22e5645806821d7
  )

COMP: Update MinimalPathExtraction to remove warnings

Update to version that removes deprecated throw decorator for functions.
The throw decorator was deprecated in C++11.


SET(LIBMV_VERSION_MAJOR 0)
SET(LIBMV_VERSION_MINOR 0)

# The standard GNU version numbering scheme is major.minor.revision
FIND_PACKAGE(Subversion)
IF(Subversion_FOUND)
  Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} ER)
  SET(SUBVERSION_REVISION ${ER_WC_REVISION})
  SET(LIBMV_VERSION_PATCH ${SUBVERSION_REVISION})
ELSE(Subversion_FOUND)
  SET(LIBMV_VERSION_PATCH 0)
ENDIF(Subversion_FOUND)

# Built from svn
SET(LIBMV_VERSION "${LIBMV_VERSION_MAJOR}.${LIBMV_VERSION_MINOR}.${LIBMV_VERSION_PATCH}")
# Alpha version [+number]
# SET(LIBMV_VERSION "${LIBMV_VERSION_MAJOR}.${LIBMV_VERSION_MINOR}-a")
# Beta version [+number]
# SET(LIBMV_VERSION "${LIBMV_VERSION_MAJOR}.${LIBMV_VERSION_MINOR}-b")
# Release candidate version [+number]
# SET(LIBMV_VERSION "${LIBMV_VERSION_MAJOR}.${LIBMV_VERSION_MINOR}-rc")

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/revision.h.in ${CMAKE_CURRENT_SOURCE_DIR}/libmv/tools/revision.h)

SET(LIBMV_VERSION_MAJOR 0)
SET(LIBMV_VERSION_MINOR 0)
SET(LIBMV_VERSION_PATCH 9) #or the svn revision

# The standard GNU version numbering scheme is major.minor.revision
IF (EXISTS ${LIBMV_SOURCE_DIR}/.svn)
  # Probably a SVN workspace, determine revision level
  FIND_PACKAGE(Subversion)
  IF(Subversion_FOUND)
    Subversion_WC_INFO(${LIBMV_SOURCE_DIR} ER)
    SET(SUBVERSION_REVISION ${ER_WC_REVISION})
    SET(LIBMV_VERSION_PATCH ${SUBVERSION_REVISION})
  ENDIF(Subversion_FOUND)
ENDIF (EXISTS ${LIBMV_SOURCE_DIR}/.svn)

# Built from svn
SET(LIBMV_VERSION "${LIBMV_VERSION_MAJOR}.${LIBMV_VERSION_MINOR}.${LIBMV_VERSION_PATCH}")
# Alpha version [+number]
# SET(LIBMV_VERSION "${LIBMV_VERSION_MAJOR}.${LIBMV_VERSION_MINOR}-a")
# Beta version [+number]
# SET(LIBMV_VERSION "${LIBMV_VERSION_MAJOR}.${LIBMV_VERSION_MINOR}-b")
# Release candidate version [+number]
# SET(LIBMV_VERSION "${LIBMV_VERSION_MAJOR}.${LIBMV_VERSION_MINOR}-rc")

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/revision.h.in ${CMAKE_CURRENT_SOURCE_DIR}/libmv/tools/revision.h)

Patch in order to compile when no there is no .svn.


vtk_module(vtkRenderingVolumeAMR
  BACKEND
    OpenGL
  DEPENDS
    vtkParallelCore
    vtkRenderingVolume
    vtkFiltersAMR
  KIT
    vtkParallel
  )

vtk_module(vtkRenderingVolumeAMR
  BACKEND
    OpenGL
  DEPENDS
    vtkParallelCore
    vtkRenderingVolumeOpenGL
    vtkFiltersAMR
  KIT
    vtkParallel
  )

Make SmartVolumeMapper available for VolumeAMR

Change-Id: I3a44b5bbbd41072177d6bb60a803d0e6c4e462ca


# Copyright (C) 2015 Luke San Antonio and Hazza Alkaabi
# All rights reserved.

find_library(LuaJit_LIBRARY luajit-5.1)
find_path(LuaJit_INCLUDE_DIR luajit-2.0/lua.h)

if(APPLE)
  set(LuaJit_COMPILE_OPTIONS "-pagezero_size 10000 -image_base 100000000")
else()
  set(LuaJit_COMPILE_OPTIONS "")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LuaJit DEFAULT_MSG LuaJit_LIBRARY
                                  LuaJit_INCLUDE_DIR)

# Copyright (C) 2015 Luke San Antonio and Hazza Alkaabi
# All rights reserved.

find_library(LuaJit_LIBRARY luajit-5.1)
find_path(LuaJit_INCLUDE_DIR lua.h PATH_SUFFIXES luajit-2.0)

if(APPLE)
  set(LuaJit_COMPILE_OPTIONS "-pagezero_size 10000 -image_base 100000000")
else()
  set(LuaJit_COMPILE_OPTIONS "")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LuaJit DEFAULT_MSG LuaJit_LIBRARY
                                  LuaJit_INCLUDE_DIR)

Use lua directory for include path

Use lua directory for include path

This means we'll have to include like: <lua.h>. This means we won't have to
change anything should we switch lua implementations.


set(MITK_CONFIG_PACKAGES )

set(_package_excludes
  Python
  OpenCL
  SYSTEM_Boost
  Boost_LIBRARIES
  SOFA_PLUGINS
  SOFA_PLUGINS_DIR
  SUPERBUILD

  KWSTYLE
  MICRON_TRACKER
  OPTITRACK_TRACKER
  TOF_KINECT
  TOF_KINECTV2
  TOF_MESASR4000
  TOF_PMDCAMBOARD
  TOF_PMDCAMCUBE
)

get_cmake_property(_cache_vars CACHE_VARIABLES)
foreach(_cache_var ${_cache_vars})
  string(REGEX REPLACE "MITK_USE_(.+)" "\\1" _package "${_cache_var}")
  if(_package AND NOT _package STREQUAL _cache_var)
    list(FIND _package_excludes ${_package} _index)
    if(_index EQUAL -1)
      list(APPEND MITK_CONFIG_PACKAGES ${_package})
    endif()
  endif()
endforeach()

set(MITK_BUILD_ALL_APPS ON CACHE BOOL "Build all MITK applications" FORCE)
set(MITK_BUILD_ALL_PLUGINS ON CACHE BOOL "Build all MITK plugins" FORCE)
set(MITK_BUILD_EXAMPLES ON CACHE BOOL "Build the MITK examples" FORCE)
set(BLUEBERRY_BUILD_ALL_PLUGINS ON CACHE BOOL "Build all BlueBerry plugins" FORCE)
set(BUILD_DiffusionMiniApps ON CACHE BOOL "Build MITK Diffusion MiniApps" FORCE)

set(MITK_CONFIG_PACKAGES )

set(_package_excludes
  Python
  OpenCL
  SYSTEM_Boost
  Boost_LIBRARIES
  SOFA_PLUGINS
  SOFA_PLUGINS_DIR
  SUPERBUILD

  KWSTYLE
  MICROBIRD_TRACKER
  MICRON_TRACKER
  OPTITRACK_TRACKER
  TOF_KINECT
  TOF_KINECTV2
  TOF_MESASR4000
  TOF_PMDCAMBOARD
  TOF_PMDCAMCUBE
  US_TELEMED_SDK
)

get_cmake_property(_cache_vars CACHE_VARIABLES)
foreach(_cache_var ${_cache_vars})
  string(REGEX REPLACE "MITK_USE_(.+)" "\\1" _package "${_cache_var}")
  if(_package AND NOT _package STREQUAL _cache_var)
    list(FIND _package_excludes ${_package} _index)
    if(_index EQUAL -1)
      list(APPEND MITK_CONFIG_PACKAGES ${_package})
    endif()
  endif()
endforeach()

set(MITK_BUILD_ALL_APPS ON CACHE BOOL "Build all MITK applications" FORCE)
set(MITK_BUILD_ALL_PLUGINS ON CACHE BOOL "Build all MITK plugins" FORCE)
set(MITK_BUILD_EXAMPLES ON CACHE BOOL "Build the MITK examples" FORCE)
set(BLUEBERRY_BUILD_ALL_PLUGINS ON CACHE BOOL "Build all BlueBerry plugins" FORCE)
set(BUILD_DiffusionMiniApps ON CACHE BOOL "Build MITK Diffusion MiniApps" FORCE)

COMP: Exclude MICROBIRD_TRACKER and US_TELEMED_SDK from build configuration "All".