SET(CMAKE_CROSSCOMPILING TRUE)

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

# specify the cross compiler
SET(CMAKE_C_COMPILER        x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER      x86_64-w64-mingw32-g++)
SET(CMAKE_Fortran_COMPILER  x86_64-w64-mingw32-gfortran)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/x86_64-w64-mingw32/sys-root/mingw )

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

SET(CMAKE_CROSSCOMPILING TRUE)

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

# specify the cross compiler
SET(CMAKE_C_COMPILER        x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER      x86_64-w64-mingw32-g++)
SET(CMAKE_Fortran_COMPILER  x86_64-w64-mingw32-gfortran)
SET(OpenMP_gomp_LIBRARY     libgomp-1.dll)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/x86_64-w64-mingw32/sys-root/mingw )

# 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 gomp openmp library for cross-compiling windows


# -*- cmake -*-

# Silence warning about overriding findZLIB.cmake with our own copy.

if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)
 cmake_policy(SET CMP0017 OLD)
 cmake_policy(SET CMP0011 NEW)
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)

# Silence warning about using policies to silence warnings about using policies.

include(Prebuilt)

set(PNG_FIND_QUIETLY ON)
set(PNG_FIND_REQUIRED ON)

if (STANDALONE)
  include(FindPNG)
else (STANDALONE)
  use_prebuilt_binary(libpng)
  if (WINDOWS)
    set(PNG_LIBRARIES libpng15)
    set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
  elseif(DARWIN)
    set(PNG_LIBRARIES png15)
    set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
  else()
    set(PNG_LIBRARIES png15)
    set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
  endif()
endif (STANDALONE)

# -*- cmake -*-

if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)
# Silence warning about overriding findZLIB.cmake with our own copy.
 cmake_policy(SET CMP0017 OLD)
# Silence warning about using policies to silence warnings about using policies.
 cmake_policy(SET CMP0011 NEW)
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)

include(Prebuilt)

set(PNG_FIND_QUIETLY ON)
set(PNG_FIND_REQUIRED ON)

if (STANDALONE)
  include(FindPNG)
else (STANDALONE)
  use_prebuilt_binary(libpng)
  if (WINDOWS)
    set(PNG_LIBRARIES libpng15)
    set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
  elseif(DARWIN)
    set(PNG_LIBRARIES png15)
    set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
  else()
    set(PNG_LIBRARIES png15)
    set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
  endif()
endif (STANDALONE)

Move comments to the lines they're commenting.


find_package (tinyfiledialogs QUIET)
if (NOT tinyfiledialogs_FOUND)
	FetchContent_Declare (
		tinyfiledialogs
		GIT_REPOSITORY [[https://git.code.sf.net/p/tinyfiledialogs/code]]
		GIT_TAG [[e11f94cd7887b101d64f74892d769f0139b5e166]]
	)

	FetchContent_GetProperties (tinyfiledialogs)
	if (NOT tinyfiledialogs_POPULATED)
		message (STATUS "Cloning tinyfiledialogs…")
		FetchContent_Populate (tinyfiledialogs)
	endif ()

	add_library( tinyfiledialogs::tinyfiledialogs INTERFACE IMPORTED)
	set_target_properties(tinyfiledialogs::tinyfiledialogs PROPERTIES
		INTERFACE_INCLUDE_DIRECTORIES "${tinyfiledialogs_SOURCE_DIR}"
		INTERFACE_SOURCES "${tinyfiledialogs_SOURCE_DIR}/tinyfiledialogs.c"
	)
endif ()

CMake: Support tinyfiledialogs installations through vcpkg


# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_VERSION}/target.cmake)

# For toolchains without a deterministic 'ar' option, see
# less ideal but tested "strip-nondeterminism" alternative at
#  https://github.com/marc-hb/zephyr/commits/strip-nondeterminism

# TODO: build future versions of the Zephyr SDK with
#      --enable-deterministic-archives?

# Ideally we'd want to _append_ -D to the list of flags and operations
# that cmake already uses by default. However as of version 3.14 cmake
# doesn't support addition, one can only replace the complete AR command.

# To see what the default flags are and find where they're defined
# in cmake's code:
# - comment out the end of the foreach line like this:
#      foreach(lang ) # ASM C CXX
# - build any sample with:
#       2>cmake.log  cmake --trace-expand ...
# - Search cmake.log for:
#      CMAKE_.*_ARCHIVE and CMAKE_.*CREATE_STATIC

# CMake's documentation is at node: CMAKE_LANG_CREATE_STATIC_LIBRARY

# At least one .a file needs 'ASM': arch/xtensa/core/startup/ because
# there's no C file there.
foreach(lang ASM C CXX)
  # GNU ar always updates the index: no need for CMAKE_RANLIB
  SET(CMAKE_${lang}_CREATE_STATIC_LIBRARY
      "<CMAKE_AR> qcD <TARGET> <LINK_FLAGS> <OBJECTS>")
endforeach()

Revert "toolchain/zephyr: invoke ar with -D for deterministic .a files"

This reverts commit b4078c557ddc / zephyrproject-rtos/zephyr#17495

This revert is needed for two reasons:

1. As reported by Lawrence King at
   https://lists.zephyrproject.org/g/users/message/1566
this breaks incremental builds with ninja:

  cd sample/hello_world
  west build -b qemu_x86
  touch src/main.c
  west build -b qemu_x86

  hello_world/build/../src/main.c:11: multiple definition of main';
  app/libapp.a(main.c.obj):samples/hello_world/build/../src/main.c:11:
  first defined here
  collect2: error: ld returned 1 exit status

  ar tf build/app/libapp.a
   main.c.obj
   main.c.obj

This does NOT break incremental builds with GNU Make, not sure why not.

2. Less urgently, I finally got someone from the CMake team to help me
and point me at an alternative solution that doesn't rely on CMake
internals: https://gitlab.kitware.com/cmake/cmake/issues/19474
I was about to try it when Lawrence reported the regression above.

Signed-off-by: Marc Herbert <77e7c7d746b52c6eb01119b65a031ae1f650246d@intel.com>


find_path(Clipper_INCLUDE_DIR polyclipping/clipper.hpp)
find_library(Clipper_LIBRARIES polyclipping)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Clipper Clipper_INCLUDE_DIR Clipper_LIBRARIES)

# - Try to find Clipper
# Once done this will define
#  Clipper_FOUND - System has Clipper
#  Clipper_INCLUDE_DIRS - The Clipper include directories
#  Clipper_LIBRARIES - The libraries needed to use Clipper
#  Clipper_DEFINITIONS - Compiler switches required for using Clipper

find_package(PkgConfig)
pkg_check_modules(PC_Clipper QUIET polyclipping.pc)
set(Clipper_DEFINITIONS ${PC_Clipper_CFLAGS_OTHER})

find_path(Clipper_INCLUDE_DIR polyclipping/clipper.hpp
  HINTS ${PC_Clipper_INCLUDEDIR} ${PC_Clipper_INCLUDE_DIRS}
  PATH_SUFFIXES libpolyclipping)

find_library(Clipper_LIBRARY NAMES polyclipping libpolyclipping
  HINTS ${PC_Clipper_LIBDIR} ${PC_Clipper_LIBRARY_DIRS} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set Clipper_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Clipper  DEFAULT_MSG
  Clipper_LIBRARY Clipper_INCLUDE_DIR)

mark_as_advanced(Clipper_INCLUDE_DIR Clipper_LIBRARY)

set(Clipper_LIBRARIES ${Clipper_LIBRARY})
set(Clipper_INCLUDE_DIRS ${Clipper_INCLUDE_DIR})

Use PkgConfig to finde Clipper.

Use PkgConfig to finde Clipper.


set(_proc_env "MACOSX_DEPLOYMENT_TARGET 10.9")

# Horrible hack to force the configure step not to find getentropy and clock_gettime.
# If we build on a version that has these defined ( even as weak symbols ) they will
# be used and then we will get run time link errors when running on versions that
# don't actually have them defined ( such as 10.11 )
if (APPLE)
 set(_proc_env "${_proc_env} ac_cv_func_getentropy no ac_cv_func_clock_gettime no")
endif()

add_external_project_or_use_system(python
  DEPENDS zlib
  CONFIGURE_COMMAND <SOURCE_DIR>/configure
                    --prefix=<INSTALL_DIR>
                    --enable-unicode=ucs4
                    --enable-shared
  PROCESS_ENVIRONMENT ${_proc_env}
  )
set (pv_python_executable "${install_location}/bin/python3" CACHE INTERNAL "" FORCE)

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

if (UNIX AND NOT APPLE)
  # Pass the -rpath flag when building python to avoid issues running the
  # executable we built.
  append_flags(LDFLAGS "-Wl,-rpath,${install_location}/lib" PROJECT_ONLY)
endif()

set(_proc_env "MACOSX_DEPLOYMENT_TARGET" "10.9")

# Horrible hack to force the configure step not to find getentropy and clock_gettime.
# If we build on a version that has these defined ( even as weak symbols ) they will
# be used and then we will get run time link errors when running on versions that
# don't actually have them defined ( such as 10.11 )
if (APPLE)
  list(APPEND _proc_env "ac_cv_func_getentropy" "no" "ac_cv_func_clock_gettime" "no")
endif()

add_external_project_or_use_system(python
  DEPENDS zlib
  CONFIGURE_COMMAND <SOURCE_DIR>/configure
                    --prefix=<INSTALL_DIR>
                    --enable-unicode=ucs4
                    --enable-shared
  PROCESS_ENVIRONMENT ${_proc_env}
  )
set (pv_python_executable "${install_location}/bin/python3" CACHE INTERNAL "" FORCE)

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

if (UNIX AND NOT APPLE)
  # Pass the -rpath flag when building python to avoid issues running the
  # executable we built.
  append_flags(LDFLAGS "-Wl,-rpath,${install_location}/lib" PROJECT_ONLY)
endif()

Use PROCESS_ENVIRONMENT as a list not a string


# FindPythonConfig
# ----------------
#
# This module locates Python libraries.
#
# This code sets the following variables:
#
# PYTHONCONFIG_FOUND - have the Python libs been found
# PYTHON_COMPILE_FLAGS - compiler flags required to include Python headers
# PYTHON_LINK_FLAGS - linker flags required to link Python libraries
#
# If calling both `find_package(PythonInterp)` and
# `find_package(PythonConfig)`, call `find_package(PythonInterp)` first.

include(FindPackageHandleStandardArgs)

find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
  set(_Python_config "${PYTHON_EXECUTABLE}-config")
  execute_process(COMMAND ${_Python_config} "--includes" OUTPUT_VARIABLE PYTHON_COMPILE_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
  execute_process(COMMAND ${_Python_config} "--ldflags" OUTPUT_VARIABLE PYTHON_LINK_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
  string(CONCAT _Python_config_message ${PYTHON_COMPILE_FLAGS} "; " ${PYTHON_LINK_FLAGS})
  unset(_Python_config)
else(PYTHONINTERP_FOUND)
  message(SEND_ERROR "Python interpreter not found")
endif(PYTHONINTERP_FOUND)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonConfig DEFAULT_MSG _Python_config_message PYTHON_COMPILE_FLAGS PYTHON_LINK_FLAGS)
unset(_Python_config_message)

# FindPythonConfig
# ----------------
#
# This module locates Python libraries.
#
# This code sets the following variables:
#
# PYTHONCONFIG_FOUND - have the Python libs been found
# PYTHON_COMPILE_FLAGS - compiler flags required to include Python headers
# PYTHON_LINK_FLAGS - linker flags required to link Python libraries
#
# If calling both `find_package(PythonInterp)` and
# `find_package(PythonConfig)`, call `find_package(PythonInterp)` first.

include(FindPackageHandleStandardArgs)

find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
  set(_Python_config "${PYTHON_EXECUTABLE}-config")
  execute_process(COMMAND ${_Python_config} "--includes" OUTPUT_VARIABLE PYTHON_COMPILE_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
  execute_process(COMMAND ${_Python_config} "--ldflags" OUTPUT_VARIABLE PYTHON_LINK_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
  set(_Python_config_message "${PYTHON_COMPILE_FLAGS}; ${PYTHON_LINK_FLAGS}")
  unset(_Python_config)
else(PYTHONINTERP_FOUND)
  message(SEND_ERROR "Python interpreter not found")
endif(PYTHONINTERP_FOUND)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonConfig DEFAULT_MSG _Python_config_message PYTHON_COMPILE_FLAGS PYTHON_LINK_FLAGS)
unset(_Python_config_message)

Remove other instance of string(CONCAT)

Remove other instance of string(CONCAT)


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

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

ENH: Update SCIFIO to lastest commit (01.21.2017)

Francois Budin (1):
      BUG: Paths to install jars and jre should be absolute

Matt McCormick (1):
      Merge pull request #34 from
  fbudin69500/BUG_Correct_install_bug_introducted_in_1069996bd0dcc6f15a5864a0d61ccba17bb4fa66

Change-Id: Icf9a5ebc9bbc31d3e65576a624ec89c8a515a8a7


itk_fetch_module(SCIFIO
  "SCIFIO (Bioformats) ImageIO plugin for ITK"
  GIT_REPOSITORY https://github.com/scifio/scifio-imageio.git
  GIT_TAG 99ccab489f9cd64ef4926cc4a539175e9207ac8d
  )

itk_fetch_module(SCIFIO
  "SCIFIO (Bioformats) ImageIO plugin for ITK"
  GIT_REPOSITORY https://github.com/scifio/scifio-imageio.git
  GIT_TAG 71a701054bdb6e19fb21d7195e5878fc01179be4
  )

Fix duplicate variables in Windows

BUG: Fix duplicate variables in Windows

Updates the scifio-imageio hash to account for a fix from mabruce, removing
duplicate variable declarations in the Write method on Windows.

Change-Id: Id07006d70822fa689be71bb045033708e1cc7234


# Copyright 2020 Google LLC
#
# 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.

include(ExternalProject)

if(TARGET firestore)
  return()
endif()

set(version Firestore-1.15.0)

ExternalProject_Add(
  firestore

  DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  URL https://github.com/firebase/firebase-ios-sdk/archive/${version}.tar.gz

  PREFIX ${PROJECT_BINARY_DIR}

  CONFIGURE_COMMAND ""
  BUILD_COMMAND ""
  INSTALL_COMMAND ""
  TEST_COMMAND ""
)

# Copyright 2020 Google LLC
#
# 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.

include(ExternalProject)

if(TARGET firestore)
  return()
endif()

# Pin to the first revision that includes these changes:
# https://github.com/firebase/firebase-ios-sdk/pull/5807.
#
# This should be released with the next version after Firestore-1.15.0.
set(version 05026f3df92cdee7b91fccc72a7195be2618acdf)

ExternalProject_Add(
  firestore

  DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  URL https://github.com/firebase/firebase-ios-sdk/archive/${version}.tar.gz

  PREFIX ${PROJECT_BINARY_DIR}

  CONFIGURE_COMMAND ""
  BUILD_COMMAND ""
  INSTALL_COMMAND ""
  TEST_COMMAND ""
)

Fix open source C++ Firestore building with -DFIREBASE_IOS_BUILD_TESTS=OFF.

PiperOrigin-RevId: 316190122


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

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

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

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

Remove BOOST_LOG_DYN_LINK definition from tests


set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
set(CMAKE_INSTALL_RPATH "./")

set(CPACK_GENERATOR "DEB" "TGZ")
set(CPACK_PACKAGE_VENDOR "osrose")
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 3)
set(CPACK_PACKAGE_VERSION_PATCH 1)

set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "RavenX8#3180")

add_compile_definitions(ASIO_STANDALONE)
add_compile_options(-Wall -Wextra)

if(DEBUG)
  add_compile_definitions(_DEBUG DEBUG)
  message(STATUS "Configured for Debug")
else()
  add_compile_definitions(NDEBUG)
  message(STATUS "Configured for Release")
endif()

set(COPY_SCRIPT_PATH "")
set(COPY_FLAT_SCRIPT_PATH "")

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  set(64BIT TRUE)
  message("-- detected 64bit")
else()
  set(64BIT FALSE)
  message("-- detected 32bit")
endif()

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
set(CMAKE_INSTALL_RPATH "./")

set(CPACK_GENERATOR "DEB" "TGZ")
set(CPACK_PACKAGE_VENDOR "osrose")
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 3)
set(CPACK_PACKAGE_VERSION_PATCH 1)

set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "RavenX8#3180")

add_compile_definitions(ASIO_STANDALONE)
add_compile_options(-Wall -Wextra)

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
  add_compile_definitions(_DEBUG DEBUG)
  message(STATUS "Configured for Debug")
else()
  add_compile_definitions(NDEBUG)
  message(STATUS "Configured for Release")
endif()

set(COPY_SCRIPT_PATH "")
set(COPY_FLAT_SCRIPT_PATH "")

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  set(64BIT TRUE)
  message("-- detected 64bit")
else()
  set(64BIT FALSE)
  message("-- detected 32bit")
endif()

Fix debug/release detection in plaform.cmake


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

include(FindPackageHandleStandardArgs)

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

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

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

message(STATUS "CMOCKA_INCLUDE_DIR = " ${CMOCKA_INCLUDE_DIR})
message(STATUS "CMOCKA_LIBRARY = " ${CMOCKA_LIBRARY})

find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARY CMOCKA_INCLUDE_DIR)

mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARY)

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

include(FindPackageHandleStandardArgs)

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

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

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

set(CMOCKA_INCLUDE_DIR ${CMOCKA_INCLUDE_DIRS})

find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARY CMOCKA_INCLUDE_DIR)

mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARY)

Add CMOCKA_INCLUDE_DIR for backwards compatibility


# Some default installation locations. These should be global, with any project
# specific locations added to the end. These paths are all relative to the
# install prefix.
#
# These paths attempt to adhere to the FHS, and are similar to those provided
# by autotools and used in many Linux distributions.
if(NOT INSTALL_RUNTIME_DIR)
  set(INSTALL_RUNTIME_DIR "bin")
endif()
if(NOT INSTALL_LIBRARY_DIR)
  set(INSTALL_LIBRARY_DIR "lib")
endif()
if(NOT INSTALL_ARCHIVE_DIR)
  set(INSTALL_ARCHIVE_DIR "lib")
endif()
if(NOT INSTALL_INCLUDE_DIR)
  set(INSTALL_INCLUDE_DIR "include")
endif()
if(NOT INSTALL_DATA_DIR)
  set(INSTALL_DATA_DIR "share")
endif()
if(NOT INSTALL_DOC_DIR)
  set(INSTALL_DOC_DIR "doc")
endif()

# Set up RPATH for the project too.
option(ENABLE_RPATH "Enable rpath support on Linux and Mac" ON)
if(UNIX AND ENABLE_RPATH)
  if(APPLE)
    set(CMAKE_INSTALL_NAME_DIR "@executable_path/../${INSTALL_LIBRARY_DIR}")
  endif()
  set(CMAKE_SKIP_BUILD_RPATH FALSE)
  set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

Use RPATH by default for build and install trees

Change-Id: Ic6ce227d54c16cd5eaf4e2482f761dd248cc723e


set (PLIBSYS_THREAD_MODEL amiga)
set (PLIBSYS_IPC_MODEL none)
set (PLIBSYS_TIME_PROFILER_MODEL amiga)
set (PLIBSYS_DIR_MODEL posix)
set (PLIBSYS_LIBRARYLOADER_MODEL amiga)
set (PLIBSYS_RWLOCK_MODEL general)

set (PLIBSYS_PLATFORM_LINK_LIBRARIES auto amiga unix)

set (PLIBSYS_PLATFORM_DEFINES
        -D_REENTRANT
)

set (PLIBSYS_THREAD_MODEL amiga)
set (PLIBSYS_IPC_MODEL amiga)
set (PLIBSYS_TIME_PROFILER_MODEL amiga)
set (PLIBSYS_DIR_MODEL posix)
set (PLIBSYS_LIBRARYLOADER_MODEL amiga)
set (PLIBSYS_RWLOCK_MODEL general)

set (PLIBSYS_PLATFORM_LINK_LIBRARIES auto amiga unix)

set (PLIBSYS_PLATFORM_DEFINES
        -D_REENTRANT
)

Enable native IPC model by default

amigaos: Enable native IPC model by default


# THIS IS A HACK to work around ctest/cdash's treatment of nightly builds
# so that we can submit two separate coverage results from the same actual
# build & test run. It will appear as two distinct builds in the dashboard,
# but for now that looks like the easiest way to get both coverage results
# to show up.

set(CTEST_SOURCE_DIRECTORY "/home/cpatrick/Dashboards/girder")
set(CTEST_BINARY_DIRECTORY "/home/cpatrick/Dashboards/girder-nightly")

file(RENAME "${CTEST_BINARY_DIRECTORY}/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/../coverage.xml")
ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )

include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Aiur.kitware")
set(CTEST_BUILD_NAME "Linux-master-nightly-js-cov")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")

file(RENAME "${CTEST_BINARY_DIRECTORY}/../coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_start("Nightly")
ctest_configure()
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()

# THIS IS A HACK to work around ctest/cdash's treatment of nightly builds
# so that we can submit two separate coverage results from the same actual
# build & test run. It will appear as two distinct builds in the dashboard,
# but for now that looks like the easiest way to get both coverage results
# to show up.

set(CTEST_SOURCE_DIRECTORY "/home/cpatrick/Dashboards/girder")
set(CTEST_BINARY_DIRECTORY "/home/cpatrick/Dashboards/girder-nightly")

file(RENAME "${CTEST_BINARY_DIRECTORY}/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/../coverage.xml")
ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )

include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Aiur.kitware")
set(CTEST_BUILD_NAME "Linux-master-nightly-js-cov")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")

ctest_start("Nightly")
ctest_configure()
file(RENAME "${CTEST_BINARY_DIRECTORY}/../coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()

Make aiur submit js coverage xml

Make aiur submit js coverage xml


macro (apply_strict_compile_options_to_this_directory)
	if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wpedantic -Werror)
	elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Wall -Wextra -pedantic -Werror)
	elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS "/W4 /wd4244 /wd4805 /wd4389 /wd4267 /WX")
	endif ()
endmacro ()

macro (apply_strict_compile_options_to_this_directory)
	if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wpedantic -Werror)
	elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Wall -Wextra -pedantic -Werror)
	elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS /W4 /wd4244 /wd4805 /wd4389 /wd4267 /WX)
	endif ()
endmacro ()

Set warning properties for MSVC properly


set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(CMAKE_CXX_EXTENSIONS off)
add_compile_options("$<$<CONFIG:DEBUG>:-DREALM_DEBUG>")
add_compile_options("$<$<CONFIG:COVERAGE>:-DREALM_DEBUG>")
add_compile_options(
    -DREALM_HAVE_CONFIG
    -Wall
    -Wextra
    -Wno-missing-field-initializers
    -Wempty-body
    -Wparentheses
    -Wunknown-pragmas
    -Wunreachable-code
)

if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
    add_compile_options(
        -Wassign-enum
        -Wbool-conversion
        -Wconditional-uninitialized
        -Wconstant-conversion
        -Wenum-conversion
        -Wint-conversion
        -Wmissing-prototypes
        -Wnewline-eof
        -Wshorten-64-to-32
    )
endif()

if(${CMAKE_GENERATOR} STREQUAL "Ninja")
    if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
    elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
    endif()
endif()

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(CMAKE_CXX_EXTENSIONS off)
add_compile_options("$<$<CONFIG:DEBUG>:-DREALM_DEBUG>")
add_compile_options("$<$<CONFIG:COVERAGE>:-DREALM_DEBUG>")
add_compile_options(
    -DREALM_HAVE_CONFIG
    -Wall
    -Wextra
    -Wno-missing-field-initializers
    -Wempty-body
    -Wparentheses
    -Wunknown-pragmas
    -Wunreachable-code
)

if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
    add_compile_options(
        -Wassign-enum
        -Wbool-conversion
        -Wconditional-uninitialized
        -Wconstant-conversion
        -Wenum-conversion
        -Wint-conversion
        -Wmissing-prototypes
        -Wnewline-eof
        -Wshorten-64-to-32
    )
endif()

if(${CMAKE_GENERATOR} STREQUAL "Ninja")
    if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
    elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
    endif()
endif()

Fix compiler checks to match clang on OS X, which CMake labels AppleClang.


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

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

# "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 "6d55842132d2ef37b6a6aeaaf810a8e745cd457c")

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

Stereo: Add support for extended and subpixel together


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

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

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

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

Update FW: configurable FPS and fix enumeration issues with AR0234


macro (apply_strict_compile_options_to_this_directory)
	if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wpedantic -Werror)
	elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS /W4 /wd4244 /wd4805 /wd4389 /wd4267 /WX)
	endif ()
endmacro ()

macro (apply_strict_compile_options_to_this_directory)
	if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wpedantic -Werror)
	elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS /W4 /wd4244 /wd4805 /wd4389 /wd4267 /wd4996 /WX)
	endif ()
endmacro ()

Disable warning on `std::strerror()` from Visual Studio


vtk_module(vtkRenderingFreeTypeOpenGL2
  IMPLEMENTS
    vtkRenderingCore
  TCL_NAME
    vtkRenderingFreeTypeOpenGLII
  BACKEND
    OpenGL2
  DEPENDS
    vtkRenderingFreeType
    vtkRenderingOpenGL2
  TEST_DEPENDS
    vtkTestingCore
    vtkTestingRendering
    vtkInteractionStyle
  KIT
    vtkOpenGL
  )

if (NOT ANDROID AND NOT APPLE_IOS)
  set(include_in_backend BACKEND OpenGL2)
endif()

vtk_module(vtkRenderingFreeTypeOpenGL2
  IMPLEMENTS
    vtkRenderingCore
  TCL_NAME
    vtkRenderingFreeTypeOpenGLII
  ${include_in_backend}
  DEPENDS
    vtkRenderingFreeType
    vtkRenderingOpenGL2
  TEST_DEPENDS
    vtkTestingCore
    vtkTestingRendering
    vtkInteractionStyle
  KIT
    vtkOpenGL
  )

Exclude freetype form iOS and andriod

Exclude freetype form iOS and andriod

Remove freetype OpenGL2 form the OpenGL2 backend when building
android or iOS.

Change-Id: I6ec244c368eb69b60ea79e3ec3d6a06850d07c60


#ifndef _CONFIG_HPP_
#define _CONFIG_HPP_

#cmakedefine ENABLE_ALSA
#cmakedefine ENABLE_MPD
#cmakedefine ENABLE_I3

#define BUILDER_SPACE_TOKEN "%__"
#define ALSA_SOUNDCARD "@SETTING_ALSA_SOUNDCARD@"
#define MPD_HOST "@SETTING_MPD_HOST@"
#define MPD_PASSWORD "@SETTING_MPD_PASSWORD@"
#define MPD_PORT @SETTING_MPD_PORT@
#define CONNECTION_TEST_IP "@SETTING_CONNECTION_TEST_IP@"
#define PATH_BACKLIGHT_VAL "@SETTING_PATH_BACKLIGHT_VAL@"
#define PATH_BACKLIGHT_MAX "@SETTING_PATH_BACKLIGHT_MAX@"
#define PATH_BATTERY_WATCH "@SETTING_PATH_BATTERY_WATCH@"
#define PATH_BATTERY_CAPACITY "@SETTING_PATH_BATTERY_CAPACITY@"
#define PATH_ADAPTER_STATUS "@SETTING_PATH_ADAPTER_STATUS@"
#define BSPWM_SOCKET_PATH "@SETTING_BSPWM_SOCKET_PATH@"
#define BSPWM_STATUS_PREFIX "@SETTING_BSPWM_STATUS_PREFIX@"
#define PATH_CPU_INFO "@SETTING_PATH_CPU_INFO@"
#define PATH_MEMORY_INFO "@SETTING_PATH_MEMORY_INFO@"

#endif // _CONFIG_HPP_

#ifndef _CONFIG_HPP_
#define _CONFIG_HPP_

#cmakedefine ENABLE_ALSA
#cmakedefine ENABLE_MPD
#cmakedefine ENABLE_NETWORK
#cmakedefine ENABLE_I3

#define BUILDER_SPACE_TOKEN "%__"
#define ALSA_SOUNDCARD "@SETTING_ALSA_SOUNDCARD@"
#define MPD_HOST "@SETTING_MPD_HOST@"
#define MPD_PASSWORD "@SETTING_MPD_PASSWORD@"
#define MPD_PORT @SETTING_MPD_PORT@
#define CONNECTION_TEST_IP "@SETTING_CONNECTION_TEST_IP@"
#define PATH_BACKLIGHT_VAL "@SETTING_PATH_BACKLIGHT_VAL@"
#define PATH_BACKLIGHT_MAX "@SETTING_PATH_BACKLIGHT_MAX@"
#define PATH_BATTERY_WATCH "@SETTING_PATH_BATTERY_WATCH@"
#define PATH_BATTERY_CAPACITY "@SETTING_PATH_BATTERY_CAPACITY@"
#define PATH_ADAPTER_STATUS "@SETTING_PATH_ADAPTER_STATUS@"
#define BSPWM_SOCKET_PATH "@SETTING_BSPWM_SOCKET_PATH@"
#define BSPWM_STATUS_PREFIX "@SETTING_BSPWM_STATUS_PREFIX@"
#define PATH_CPU_INFO "@SETTING_PATH_CPU_INFO@"
#define PATH_MEMORY_INFO "@SETTING_PATH_MEMORY_INFO@"

#endif // _CONFIG_HPP_

Include build flag in config

fix(core): Include build flag in config


function(add_lib name)
	cmake_parse_arguments (ARG
		"CPP" # optional keywords
		"" # one value keywords
		"SOURCES;LINK_LIBRARIES;LINK_ELEKTRA" # multi value keywords
		${ARGN}
	)

	add_headers(ARG_SOURCES)
	if (ARG_CPP)
		add_cppheaders(ARG_SOURCES)
	endif (ARG_CPP)

	if (BUILD_SHARED)
		add_library (elektra-${name} SHARED ${ARG_SOURCES})
		add_dependencies (elektra-${name} kdberrors_generated)

		target_link_libraries (elektra-${name} elektra-core ${ARG_LINK_ELEKTRA})
	endif (BUILD_SHARED)

	set_property (GLOBAL APPEND PROPERTY "elektra-full_SRCS"
		${ARG_SOURCES}
		)

	set_property (GLOBAL APPEND PROPERTY "elektra-extension_LIBRARIES"
		elektra-${name}
		)

	if (BUILD_SHARED)
		target_link_libraries (elektra-${name}
			${ARG_LINK_LIBRARIES})

		install (TARGETS elektra-${name} DESTINATION lib${LIB_SUFFIX} EXPORT ElektraTargetsLibelektra)
	endif (BUILD_SHARED)

endfunction()

function (add_lib name)
	cmake_parse_arguments (ARG
			       "CPP" # optional keywords
			       "" # one value keywords
			       "SOURCES;LINK_LIBRARIES;LINK_ELEKTRA" # multi value keywords
			       ${ARGN})

	add_headers (ARG_SOURCES)
	if (ARG_CPP)
		add_cppheaders (ARG_SOURCES)
	endif (ARG_CPP)

	if (BUILD_SHARED)
		add_library (elektra-${name} SHARED ${ARG_SOURCES})
		add_dependencies (elektra-${name} kdberrors_generated)

		target_link_libraries (elektra-${name} elektra-core ${ARG_LINK_ELEKTRA})
	endif (BUILD_SHARED)

	set_property (GLOBAL APPEND PROPERTY "elektra-full_SRCS" ${ARG_SOURCES})

	set_property (GLOBAL APPEND PROPERTY "elektra-extension_LIBRARIES" elektra-${name})

	if (BUILD_SHARED)
		target_link_libraries (elektra-${name} ${ARG_LINK_LIBRARIES})

		install (TARGETS elektra-${name} DESTINATION lib${LIB_SUFFIX} EXPORT ElektraTargetsLibelektra)
	endif (BUILD_SHARED)

endfunction ()

Add Lib: Reformat CMake code

Add Lib: Reformat CMake code


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

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

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

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

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

find_package(LLVM REQUIRED CONFIG)

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

Add call to find_package to load LLVM dependencies

ClangConfig requires LLVMConfig, so add find_package call in
ClangConfig so find_package(clang REQUIRED CONFIG) will just work.  This
makes it easier for cmake based projects to use clang, e.g., tools using
ClangTooling.

Patch by Don Hinton

Differential Revision: http://reviews.llvm.org/D13622

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


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


# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

find_program(CCACHE "ccache")
if(CCACHE)
    set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
    set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif()

include(${MBED_CONFIG_PATH}/mbed_config.cmake)

set(MBED_TOOLCHAIN_FILE_USED FALSE)

# Set default toolchain file
if(NOT CMAKE_TOOLCHAIN_FILE)
    set(MBED_TOOLCHAIN_FILE_USED TRUE)

    set(CMAKE_TOOLCHAIN_FILE "${MBED_PATH}/tools/cmake/toolchain.cmake" CACHE INTERNAL "")

    # Specify locations for toolchains and generic options
    include(${MBED_PATH}/tools/cmake/toolchains/${MBED_TOOLCHAIN}.cmake)

    # Specify available build profiles and add options for the selected build profile
    include(${MBED_PATH}/tools/cmake/profile.cmake)
endif()

enable_language(C CXX ASM)

# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

find_program(CCACHE "ccache")
if(CCACHE)
    set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
    set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif()

include(${MBED_CONFIG_PATH}/mbed_config.cmake)

# Set default toolchain file
if(NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED)
    set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "")

    set(CMAKE_TOOLCHAIN_FILE "${MBED_PATH}/tools/cmake/toolchain.cmake" CACHE INTERNAL "")

    # Specify locations for toolchains and generic options
    include(${MBED_PATH}/tools/cmake/toolchains/${MBED_TOOLCHAIN}.cmake)

    # Specify available build profiles and add options for the selected build profile
    include(${MBED_PATH}/tools/cmake/profile.cmake)
endif()

enable_language(C CXX ASM)

Fix error that prevented re-build

CMake: Fix error that prevented re-build

Promote MBED_TOOLCHAIN_FILE_USED to cache variable so
its previous state can be recalled when re-building. This
is because CMAKE_TOOLCHAIN_FILE is also a cache variable and its
value is set on first run when it has not been set.


set(CTEST_SOURCE_DIRECTORY "$ENV{GIRDER_SOURCE_DIR}")
set(CTEST_BINARY_DIRECTORY "$ENV{GIRDER_BUILD_DIR}")

include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Travis")
set(CTEST_BUILD_NAME "Linux-$ENV{TRAVIS_BRANCH}")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(MINERVA_COVERAGE_CONFIG "${CTEST_SOURCE_DIRECTORY}/plugins/minerva/plugin_tests/minerva.coveragerc")

ctest_start("Continuous")
ctest_configure(
  OPTIONS
  "-DPYTHON_COVERAGE=$ENV{PY_COVG};-DPYTHON_VERSION=$ENV{TRAVIS_PYTHON_VERSION};-DSPARK_TEST_MASTER_URL=spark://localhost:7077;-DPYTHON_COVERAGE_CONFIG=${MINERVA_COVERAGE_CONFIG}"
)
ctest_build()
ctest_test(
  PARALLEL_LEVEL 1
  INCLUDE "(minerva|coverage)"
  RETURN_VALUE res
)
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()

file(REMOVE "${CTEST_BINARY_DIRECTORY}/test_failed")
if(NOT res EQUAL 0)
  file(WRITE "${CTEST_BINARY_DIRECTORY}/test_failed" "error")
  message(FATAL_ERROR "Test failures occurred.")
endif()

set(CTEST_SOURCE_DIRECTORY "$ENV{GIRDER_SOURCE_DIR}")
set(CTEST_BINARY_DIRECTORY "$ENV{GIRDER_BUILD_DIR}")

include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Travis")
set(CTEST_BUILD_NAME "Linux-$ENV{TRAVIS_BRANCH}")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(MINERVA_COVERAGE_CONFIG "${CTEST_SOURCE_DIRECTORY}/plugins/minerva/plugin_tests/minerva.coveragerc")
set(config_opts "")

list(APPEND config_opts
  "-DPYTHON_COVERAGE=$ENV{PY_COVG}"
  "-DPYTHON_VERSION=$ENV{TRAVIS_PYTHON_VERSION}"
  "-DSPARK_TEST_MASTER_URL=spark://localhost:7077"
  "-DPYTHON_COVERAGE_CONFIG=${MINERVA_COVERAGE_CONFIG}"
  "-DCOVERAGE_MINIMUM_PASS=69"
  "-DJS_COVERAGE_MINIMUM_PASS=23"
)

ctest_start("Continuous")
ctest_configure(
  OPTIONS "${config_opts}"
)
ctest_build()
ctest_test(
  PARALLEL_LEVEL 1
  INCLUDE "(minerva|coverage)"
  RETURN_VALUE res
)
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()

file(REMOVE "${CTEST_BINARY_DIRECTORY}/test_failed")
if(NOT res EQUAL 0)
  file(WRITE "${CTEST_BINARY_DIRECTORY}/test_failed" "error")
  message(FATAL_ERROR "Test failures occurred.")
endif()

Set coverage thresholds so that the test suite passes


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

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

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

# http://www.x.org/releases/X11R7.7/src/proto/
hunter_add_version(
    PACKAGE_NAME
    xproto
    VERSION
    "7.0.23"
    URL
    "http://www.x.org/releases/X11R7.7/src/proto/xproto-7.0.23.tar.bz2"
    SHA1
    5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2
)

hunter_configuration_types(xproto CONFIGURATION_TYPES Release)
hunter_pick_scheme(DEFAULT url_sha1_autotools)
hunter_cacheable(xproto)
hunter_download(
    PACKAGE_NAME xproto
    PACKAGE_INTERNAL_DEPS_ID "1"
    PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc"
)

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

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

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

# http://www.x.org/releases/X11R7.7/src/proto/
hunter_add_version(
    PACKAGE_NAME
    xproto
    VERSION
    "7.0.23"
    URL
    "http://www.x.org/releases/X11R7.7/src/proto/xproto-7.0.23.tar.bz2"
    SHA1
    5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2
)

hunter_configuration_types(xproto CONFIGURATION_TYPES Release)
hunter_pick_scheme(DEFAULT url_sha1_autotools)
hunter_cmake_args(
    xproto
    CMAKE_ARGS
      DEPENDS_ON_PACKAGES=xorg-macros
)
hunter_cacheable(xproto)
hunter_download(
    PACKAGE_NAME xproto
    PACKAGE_INTERNAL_DEPS_ID "2"
    PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc"
)

Package xproto: added dependency for xorg-macros


find_package(Boost COMPONENTS
  python
  REQUIRED
  )

find_package(PythonLibs REQUIRED)

include_directories(
  ${PYTHON_INCLUDE_PATH}
  ${Boost_INCLUDE_DIRS}
  )

set(ECTO_DEP_LIBS ${Boost_LIBRARIES}
  ${PYTHON_LIBRARIES}
)

#detect the python version and install directories
find_package(PythonInterp REQUIRED)

execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
          ERROR_VARIABLE PYTHON_VERSION_FULL
          OUTPUT_STRIP_TRAILING_WHITESPACE)

string(REGEX MATCH "[0-9].[0-9]" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")

if(UNIX)
    set(PYTHON_PLUGIN_INSTALL_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
    set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages)
elseif(WIN32)
    get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE CACHE)
    set(PYTHON_PLUGIN_INSTALL_PATH "${PYTHON_PATH}/Lib/site-packages/opencv")
    set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages")
endif()

find_package(Boost COMPONENTS
  python
  REQUIRED
  )

find_package(PythonLibs REQUIRED)

include_directories(
  ${PYTHON_INCLUDE_PATH}
  ${Boost_INCLUDE_DIRS}
  )

set(ECTO_DEP_LIBS ${Boost_LIBRARIES}
  ${PYTHON_LIBRARIES}
)

#detect the python version and install directories
find_package(PythonInterp REQUIRED)

execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
          ERROR_VARIABLE PYTHON_VERSION_FULL
          OUTPUT_STRIP_TRAILING_WHITESPACE)

string(REGEX MATCH "[0-9].[0-9]" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")

if(UNIX)
    if(APPLE)
        set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
    else() #debian based assumed, install to the dist-packages.
        set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
    endif()
elseif(WIN32)
    get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE CACHE)
    set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages" CACHE PATH "Where to install the python packages.")
endif()

Install to dist-packages by default on ubuntu.


# FindAllegro
# -----------
#
# Finds the Allegro 5 Library... or at least tries.
#
# This will define the following variables::
#
#   Allegro_FOUND    - True if the system has the Foo library
#   Allegro_VERSION  - The version of the Foo library which was found
#
# and the following imported targets::
#
#   Allegro::AllegroMain   - The Allegro 5 library

find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_Allegro QUIET IMPORTED_TARGET allegro-5)

find_path(Allegro_INCLUDE_DIR
	NAMES ./allegro5/allegro5.h ./allegro5/allegro.h
	PATHS ${PC_Allegro_INCLUDE_DIRS}
	PATH_SUFFIXES
)

find_library(Allegro_LIBRARY
	NAMES allegro
	PATH ${PC_Allegro_LIBRARY_DIRS}
)

set(Allegro_VERSION ${PC_ALLEGRO_VERSION})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Allegro
	FOUND_VAR Allegro_FOUND
	REQUIRED_VARS
		Allegro_LIBRARY
		Allegro_INCLUDE_DIR
	VERSION_VAR Allegro_VERSION
)

# FindAllegro
# -----------
# Copyright (c) 2018 Rodolfo Lam. All Rights Reserved.
#
# Finds the Allegro 5 Library... or at least tries.
#
# This will define the following variables::
#
#   Allegro_FOUND    - True if the system has the Foo library
#   Allegro_VERSION  - The version of the Foo library which was found
#
# and the following imported targets::
#
#   Allegro::AllegroMain   - The Allegro 5 library

find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_Allegro QUIET IMPORTED_TARGET allegro-5)

find_path(Allegro_INCLUDE_DIR
	NAMES ./allegro5/allegro5.h ./allegro5/allegro.h
	PATHS ${PC_Allegro_INCLUDE_DIRS}
	PATH_SUFFIXES
)

find_library(Allegro_LIBRARY
	NAMES allegro
	PATH ${PC_Allegro_LIBRARY_DIRS}
)

set(Allegro_VERSION ${PC_ALLEGRO_VERSION})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Allegro
	FOUND_VAR Allegro_FOUND
	REQUIRED_VARS
		Allegro_LIBRARY
		Allegro_INCLUDE_DIR
	VERSION_VAR Allegro_VERSION
)

Add again file on Windows

Add again file on Windows

File was deleted when the ALL CAPS version was deleted.


set (PLIB_THREAD_MODEL posix)
set (PLIB_IPC_MODEL posix)
set (PLIB_TIME_PROFILER_MODEL posix)
set (PLIB_DIR_MODEL posix)

set (PLIB_PLATFORM_DEFINES
        -D_PTHREADS
        -D_POSIX_C_SOURCE=199506L
)

set (PLIB_PLATFORM_LINK_LIBRARIES pthread)

set (PLIB_THREAD_MODEL posix)
set (PLIB_IPC_MODEL posix)
set (PLIB_TIME_PROFILER_MODEL posix)
set (PLIB_DIR_MODEL posix)

set (PLIB_PLATFORM_DEFINES
        -D_PTHREADS
        -D_POSIX_C_SOURCE=199506L
        -D_BSD_TYPES
)

set (PLIB_PLATFORM_LINK_LIBRARIES pthread)

cmake: Use BSD types on IRIX for struct timeval


SET (IRRIMGUI_NATIVE_OPENGL OFF CACHE BOOL "Enables the native OpenGL Driver for IMGUI (ATTENTION: This is just a fallback solution!).")

if (IRRIMGUI_NATIVE_OPENGL)
	message(STATUS "Use native OpenGL render driver (Fallback solution, do not use it for productive work!)...")
	ADD_DEFINITIONS(
	-D_IRRIMGUI_NATIVE_OPENGL_
	)
	SET (IRRIMGUI_FAST_OPENGL_TEXTURE_CREATION ON CACHE BOOL "Enables the fast OpenGL texture creation to translate a ITexture object to an OpenGL handle instead of creating a copy. This is a very instable hack. Disable this, when the example 7 (RenderWindow) fails.")
	INCLUDE(DependencyOpenGL)
else ()
	message(STATUS "Use Irrlicht based render driver...")
endif ()

if (IRRIMGUI_FAST_OPENGL_TEXTURE_CREATION)
	message(STATUS "Use fast OpenGL texture ID creation (fast but risky!)...")
	ADD_DEFINITIONS(
	-D_IRRIMGUI_FAST_OPENGL_TEXTURE_HANDLE_
	)
else ()
	message(STATUS "Creaty texture copy for generating OpenGL texture IDs...")
endif ()

SET (IRRIMGUI_NATIVE_OPENGL OFF CACHE BOOL "Enables the native OpenGL Driver for IMGUI (ATTENTION: This is just a fallback solution!).")

if (IRRIMGUI_NATIVE_OPENGL)
	message(STATUS "Use native OpenGL render driver (Fallback solution, do not use it for productive work!)...")
	ADD_DEFINITIONS(
	-D_IRRIMGUI_NATIVE_OPENGL_
	)
	SET (IRRIMGUI_FAST_OPENGL_TEXTURE_CREATION ON CACHE BOOL "Enables the fast OpenGL texture creation to translate a ITexture object to an OpenGL handle instead of creating a copy. This is a very instable hack. Disable this, when the example 7 (RenderWindow) fails.")
else ()
	message(STATUS "Use Irrlicht based render driver...")
endif ()

if (IRRIMGUI_FAST_OPENGL_TEXTURE_CREATION)
	message(STATUS "Use fast OpenGL texture ID creation (fast but risky!)...")
	ADD_DEFINITIONS(
	-D_IRRIMGUI_FAST_OPENGL_TEXTURE_HANDLE_
	)
else ()
	message(STATUS "Creaty texture copy for generating OpenGL texture IDs...")
endif ()

Include the OpenGL dependency script on high level.


itk_fetch_module(IOFDF
  "FDFImageIO plugin for ITK. Authors Gleen Pierce/Nick Tustison/Kent Williams"
  GIT_REPOSITORY http://github.com/InsightSoftwareConsortium/itkFDFImageIO.git
  GIT_TAG 570f6a3202d9a8b301945b9ff05950fe69ee0e9c
  )

itk_fetch_module(IOFDF
  "FDFImageIO plugin for ITK. Authors Gleen Pierce/Nick Tustison/Kent Williams"
  GIT_REPOSITORY http://github.com/InsightSoftwareConsortium/itkFDFImageIO.git
  GIT_TAG f52592da33c226b9ffc43a173d3c747b8fc4f241
  )

Bring in IOFDF license updates.

BUG: Bring in IOFDF license updates.

This update includes updates to the license header from GPL to Apache 2.

Change-Id: I410c560459574c2c800dde6f56dd1873560c5ba0


# Find the Berkeley DB include files and libraries. Sets the following
# variables:
#   BERKELEY_DB_INCLUDE_DIR
#   BERKELEY_DB_FOUND

find_path(BERKELEY_DB_INCLUDE_DIR db.h
    /opt/local/include/db47
    /usr/local/include/db4
    /usr/local/include
    /usr/include/db4
    /usr/include
)

find_library(BERKELEY_DB_LIBRARY NAMES db)

if (BERKELEY_DB_LIBRARY AND BERKELEY_DB_INCLUDE_DIR)
  set(BERKELEY_DB_LIBRARIES ${BDB_LIBRARY})
  set(BERKELEY_DB_FOUND "YES")
else ()
  set(BERKELEY_DB_FOUND "NO")
endif ()

if (BERKELEY_DB_FOUND)
  if (NOT BERKELEY_DB_FIND_QUIETLY)
    message(STATUS "Found BerkeleyDB: ${BDB_LIBRARIES}")
  else ()
    message(STATUS "NOT FOUND BDB")
  endif ()
else ()
  if (BERKELEY_DB_FIND_REQUIRED)
    message(FATAL_ERROR "Could not find BerkeleyDB library")
  endif ()
endif ()

# Find the Berkeley DB include files and libraries. Sets the following
# variables:
#   BERKELEY_DB_INCLUDE_DIR
#   BERKELEY_DB_FOUND
#   BERKELEY_DB_LIBRARIES

find_path(BERKELEY_DB_INCLUDE_DIR db.h
    /opt/local/include/db47
    /usr/local/include/db4
    /usr/local/include
    /usr/include/db4
    /usr/include
)

find_library(BERKELEY_DB_LIBRARY NAMES db)

if (BERKELEY_DB_LIBRARY AND BERKELEY_DB_INCLUDE_DIR)
  set(BERKELEY_DB_LIBRARIES ${BDB_LIBRARY})
  set(BERKELEY_DB_FOUND "YES")
else ()
  set(BERKELEY_DB_FOUND "NO")
endif ()

if (BERKELEY_DB_FOUND)
  if (NOT BERKELEY_DB_FIND_QUIETLY)
    message(STATUS "Found BerkeleyDB: ${BDB_LIBRARIES}")
  else ()
    message(STATUS "NOT FOUND BDB")
  endif ()
else ()
  if (BERKELEY_DB_FIND_REQUIRED)
    message(FATAL_ERROR "Could not find BerkeleyDB library")
  endif ()
endif ()

Fix comment in CMake file for BDB.

Fix comment in CMake file for BDB.


set(proj SimpleITKExamples)

# Set dependency list
set(SimpleITKExamples_DEPENDENCIES "SimpleITK")

if (${BUILD_EXAMPLES} )

  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )

  ExternalProject_Add(${proj}
    DOWNLOAD_COMMAND ""
    UPDATE_COMMAND ""
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../Examples
    BINARY_DIR ${proj}-build
    CMAKE_GENERATOR ${gen}
    CMAKE_ARGS
      --no-warn-unused-cli
      -C "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt"
      ${ep_common_args}
      -DITK_DIR:PATH=${ITK_DIR}
      -DSimpleITK_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/cmake/SimpleITK-1.1/
      -DCMAKE_SKIP_RPATH:BOOL=ON
      -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
    BUILD_COMMAND ${BUILD_COMMAND_STRING}
    INSTALL_COMMAND ""
    DEPENDS "${SimpleITKExamples_DEPENDENCIES}"
    ${External_Project_USES_TERMINAL}
    )

endif()

set(proj SimpleITKExamples)

# Set dependency list
set(SimpleITKExamples_DEPENDENCIES "SimpleITK")

if (${BUILD_EXAMPLES} )

  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )

  ExternalProject_Add(${proj}
    DOWNLOAD_COMMAND ""
    UPDATE_COMMAND ""
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../Examples
    BINARY_DIR ${proj}-build
    CMAKE_GENERATOR ${gen}
    CMAKE_ARGS
      --no-warn-unused-cli
      -C "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt"
      ${ep_common_args}
      -DITK_DIR:PATH=${ITK_DIR}
      -DSimpleITK_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/cmake/SimpleITK-1.3/
      -DCMAKE_SKIP_RPATH:BOOL=ON
      -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
    BUILD_COMMAND ${BUILD_COMMAND_STRING}
    INSTALL_COMMAND ""
    DEPENDS "${SimpleITKExamples_DEPENDENCIES}"
    ${External_Project_USES_TERMINAL}
    )

endif()

Update the SimpleITK Examples superbuild sitk directory


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

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

# "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 "4edb4923933e4cf2750f1958e4dee77de2cdca3f")

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

Fix still image output in RGB postprocessing


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

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

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

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

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

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

Update FW to latest develop

Update FW to latest develop


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

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

# "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 "31be3c3f138f11050b6a3d6ab6ad7f686f86e18f")

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

Fix a potential crash with `DEPTHAI_WATCHDOG=0`


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

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

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

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

Update FW, add initial support for IMX582/IMX586


# Copyright (c) 2011, Christian Rorvik
# Distributed under the Simplified BSD License (See accompanying file LICENSE.txt)

vpm_depend(boost)

add_definitions(-DBOOST_TEST_ALTERNATIVE_INIT_API)

vpm_include_directories(${CMAKE_CURRENT_LIST_DIR}/include)

macro(crunch_add_test _name)
  # Shared build target for all tests
  if(NOT TARGET build-tests)
    add_custom_target(build-tests)
  endif()

  # Shared run target for all tests
  if(NOT TARGET run-tests)
    add_custom_target(run-tests)
  endif()

  # Run target for this test
  add_custom_target("run-${_name}"
    ALL
    ${_name} "--log_level=message"
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    VERBATIM)

  # Add dependencies on shared build and run targets
  add_dependencies(build-tests ${_name})
  add_dependencies(run-tests "run-${_name}")
endmacro()

# Copyright (c) 2011, Christian Rorvik
# Distributed under the Simplified BSD License (See accompanying file LICENSE.txt)

vpm_set_default_version(boost proxy)
vpm_depend(boost)

add_definitions(-DBOOST_TEST_ALTERNATIVE_INIT_API)

vpm_include_directories(${CMAKE_CURRENT_LIST_DIR}/include)

macro(crunch_add_test _name)
  # Shared build target for all tests
  if(NOT TARGET build-tests)
    add_custom_target(build-tests)
  endif()

  # Shared run target for all tests
  if(NOT TARGET run-tests)
    add_custom_target(run-tests)
  endif()

  # Run target for this test
  add_custom_target("run-${_name}"
    ALL
    ${_name} "--log_level=message"
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    VERBATIM)

  # Add dependencies on shared build and run targets
  add_dependencies(build-tests ${_name})
  add_dependencies(run-tests "run-${_name}")
endmacro()

Set default versions for dependencies

Set default versions for dependencies


set(thread_naming_defines)

include(CMakePushCheckState)
include(CheckFunctionExists)

cmake_push_check_state()
check_function_exists(setproctitle HAVE_SETPROCTITLE)
cmake_pop_check_state()

if (HAVE_SETPROCTITLE)
  set(thread_naming_defines
    ${thread_naming_defines}
    HAVE_SETPROCTITLE)
endif ()

set(thread_naming_defines)

include(CMakePushCheckState)
include(CheckFunctionExists)

if (CMAKE_USE_PTHREADS_INIT)
  cmake_push_check_state()
  set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
  check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
  check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP)
  cmake_pop_check_state()

  if (HAVE_PTHREAD_SETNAME_NP OR HAVE_PTHREAD_SET_NAME_NP)
    set(thread_naming_defines
      ${thread_naming_defines}
      HAVE_PTHREAD_NAMING)
  endif ()

  if (HAVE_PTHREAD_SETNAME_NP)
    set(thread_naming_defines
      ${thread_naming_defines}
      HAVE_PTHREAD_SETNAME_NP)

    set(cmakefiles_dir
      "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles")
    set(pthread_setname_np_takes_id_path
      "${cmakefiles_dir}/pthread_setname_np_takes_id.cxx")
    file(WRITE "${pthread_setname_np_takes_id_path}"
"
#include <pthread.h>

#include <cstdlib>

int
main()
{
  pthread_t const tid = pthread_self();

  pthread_setname_np(tid, \"test\");

  return EXIT_SUCCESS;
}
")
    try_compile(PTHREAD_SETNAME_NP_TAKES_ID
      "${cmakefiles_dir}/pthread_setname_np_takes_id"
      "${pthread_setname_np_takes_id_path}"
      CMAKE_FLAGS
        "-DLINK_LIBRARIES=${CMAKE_THREAD_LIBS_INIT}")

    if (PTHREAD_SETNAME_NP_TAKES_ID)
      set(thread_naming_defines
        ${thread_naming_defines}
        PTHREAD_SETNAME_NP_TAKES_ID)
    endif ()
  endif ()

  if (HAVE_PTHREAD_SET_NAME_NP)
    set(thread_naming_defines
      ${thread_naming_defines}
      HAVE_PTHREAD_SET_NAME_NP)
  endif ()
endif ()

cmake_push_check_state()
check_function_exists(setproctitle HAVE_SETPROCTITLE)
cmake_pop_check_state()

if (HAVE_SETPROCTITLE)
  set(thread_naming_defines
    ${thread_naming_defines}
    HAVE_SETPROCTITLE)
endif ()

Add detection of naming threads using pthreads


set(proj SimpleITKExamples)

# Set dependency list
set(SimpleITKExamples_DEPENDENCIES "SimpleITK")

if (${BUILD_EXAMPLES} )

  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )

  ExternalProject_Add(${proj}
    DOWNLOAD_COMMAND ""
    UPDATE_COMMAND ""
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../Examples
    BINARY_DIR ${proj}-build
    CMAKE_GENERATOR ${gen}
    CMAKE_ARGS
      --no-warn-unused-cli
      -C "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt"
      ${ep_common_args}
      -DSimpleITK_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/cmake/SimpleITK-1.0/
      -DCMAKE_SKIP_RPATH:BOOL=ON
      -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
    BUILD_COMMAND ${BUILD_COMMAND_STRING}
    INSTALL_COMMAND ""
    DEPENDS "${SimpleITKExamples_DEPENDENCIES}"
    ${External_Project_USES_TERMINAL}
    )

endif()

set(proj SimpleITKExamples)

# Set dependency list
set(SimpleITKExamples_DEPENDENCIES "SimpleITK")

if (${BUILD_EXAMPLES} )

  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )

  ExternalProject_Add(${proj}
    DOWNLOAD_COMMAND ""
    UPDATE_COMMAND ""
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../Examples
    BINARY_DIR ${proj}-build
    CMAKE_GENERATOR ${gen}
    CMAKE_ARGS
      --no-warn-unused-cli
      -C "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt"
      ${ep_common_args}
      -DSimpleITK_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/cmake/SimpleITK-1.1/
      -DCMAKE_SKIP_RPATH:BOOL=ON
      -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
    BUILD_COMMAND ${BUILD_COMMAND_STRING}
    INSTALL_COMMAND ""
    DEPENDS "${SimpleITKExamples_DEPENDENCIES}"
    ${External_Project_USES_TERMINAL}
    )

endif()

Update the SimpleITK_DIR version to the current SimpleITK version


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

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

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

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

Update FW: reduce ColorCamera still pool: 4 -> 1 frame


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

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

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

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

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

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

Update FW: initial support for LUX-D-LITE: IMX214 and OV7251


# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(SphinxExamples
  "This module builds the examples found at http://itk.org/ITKExamples/"
  GIT_REPOSITORY http://itk.org/ITKExamples.git
  # 2015-07-02
  GIT_TAG 890667eaa7dbab6111aabd51432d1aeadca738f9
  )

# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(SphinxExamples
  "This module builds the examples found at http://itk.org/ITKExamples/"
  GIT_REPOSITORY http://itk.org/ITKExamples.git
  # 2015-07-09
  GIT_TAG 2bc08a52aa0437da776cc777157f25b7b525b46f
  )

Update Sphinx for ITK 4.8.0

ENH: Update Sphinx for ITK 4.8.0

Change-Id: I55573c60466a88a805c6e2a096021e4c49933f91


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

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

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

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

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

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

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

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

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

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

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

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

# backported fix from ITK4
string(REGEX REPLACE "typedef typename ParametersType::ValueType +ParameterValueType;" "typedef typename TransformType::ScalarType                      ParameterValueType;" sourceCode2 ${sourceCode2})

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

# third patch
# read whole file
file(STRINGS Code/Common/itkImageSource.h sourceCode3 NEWLINE_CONSUME)

# remove ITK_NO_RETURN since the method sometimes returns which makes clang based builds crash
string(REGEX REPLACE "ITK_NO_RETURN" "" sourceCode3 ${sourceCode3})

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

Patch for ITK clang compatibility

Patch for ITK clang compatibility


# 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})
  message("Using Raspberry Pi Tools found in $ENV{PI_TOOLS_HOME}")
else()
  message("PI_TOOLS_HOME is not set; You must tell CMake where to find Raspberry Pi Tools (cross-compiler)")
  return()
endif()

SET (PiToolsDir arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi)

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

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

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

# 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})
  message("Using Raspberry Pi Tools found in $ENV{PI_TOOLS_HOME}")
else()
  message("PI_TOOLS_HOME is not set; You must tell CMake where to find Raspberry Pi Tools (cross-compiler)")
  return()
endif()

SET (PiToolsDir arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi)

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

# where is the target environment
SET (CMAKE_FIND_ROOT_PATH $ENV{PI_TOOLS_HOME}/${PiToolsDir} $ENV{PI_TOOLS_HOME}/${PiToolsDir}/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 the include path for external cross compiled library (like curl)


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

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

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

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

Update FW: - fix for high system load crash, especially on PoE devices - for for OV9282 as MonoCamera on RGB/CAM_A socket


# Copyright (c) 2011, Christian Rorvik
# Distributed under the Simplified BSD License (See accompanying file LICENSE.txt)

vpm_set_default_version(boost proxy)
vpm_depend(boost)

vpm_include_directories(${CMAKE_CURRENT_LIST_DIR}/include)

macro(crunch_add_test _name)
  # Shared build target for all tests
  if(NOT TARGET build-tests)
    add_custom_target(build-tests)
  endif()

  # Shared run target for all tests
  if(NOT TARGET run-tests)
    add_custom_target(run-tests)
  endif()

  # Run target for this test
  add_custom_target("run-${_name}"
    ALL
    ${_name} "--log_level=message"
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    VERBATIM)

  # Add dependencies on shared build and run targets
  add_dependencies(build-tests ${_name})
  add_dependencies(run-tests "run-${_name}")
endmacro()

# Copyright (c) 2011-2013, Christian Rorvik
# Distributed under the Simplified BSD License (See accompanying file LICENSE.txt)

vpm_set_default_variant(boost proxy)
vpm_set_default_version(boost 1.53.0)
vpm_depend(boost)

vpm_include_directories(${CMAKE_CURRENT_LIST_DIR}/include)

macro(crunch_add_test _name)
  # Shared build target for all tests
  if(NOT TARGET build-tests)
    add_custom_target(build-tests)
  endif()

  # Shared run target for all tests
  if(NOT TARGET run-tests)
    add_custom_target(run-tests)
  endif()

  # Run target for this test
  add_custom_target("run-${_name}"
    ALL
    ${_name} "--log_level=message"
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    VERBATIM)

  # Add dependencies on shared build and run targets
  add_dependencies(build-tests ${_name})
  add_dependencies(run-tests "run-${_name}")
endmacro()

Set boost default version and variant to 1.53.0 proxy


if(MITK_USE_Boost)

  if(NOT MITK_USE_SYSTEM_Boost)
    set(Boost_NO_SYSTEM_PATHS 1)
  endif()

  set(Boost_USE_MULTITHREADED 1)
  set(Boost_USE_STATIC_LIBS 0)
  set(Boost_USE_STATIC_RUNTIME 0)

  if(MITK_USE_Boost_LIBRARIES)
    find_package(Boost 1.54.0 REQUIRED COMPONENTS ${MITK_USE_Boost_LIBRARIES})
  else()
    find_package(Boost 1.54.0 REQUIRED)
  endif()

  list(APPEND ALL_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
  if(Boost_LIBRARIES)
    list(APPEND ALL_LIBRARIES ${Boost_LIBRARIES})
    link_directories(${Boost_LIBRARY_DIRS})
  endif()

endif(MITK_USE_Boost)

if(MITK_USE_Boost)

  if(NOT MITK_USE_SYSTEM_Boost)
    set(Boost_NO_SYSTEM_PATHS 1)
  endif()

  set(Boost_USE_MULTITHREADED 1)
  set(Boost_USE_STATIC_LIBS 0)
  set(Boost_USE_STATIC_RUNTIME 0)

  if(MITK_USE_Boost_LIBRARIES)
    if(NOT MITK_USE_SYSTEM_Boost)
      set(BOOST_INCLUDEDIR ${CMAKE_BINARY_DIR}/Boost-install/include/boost-1_54)
      set(BOOST_LIBRARYDIR ${CMAKE_BINARY_DIR}/Boost-install/lib)
    endif()
    find_package(Boost 1.54.0 REQUIRED COMPONENTS ${MITK_USE_Boost_LIBRARIES})
  else()
    find_package(Boost 1.54.0 REQUIRED)
  endif()

  list(APPEND ALL_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
  if(Boost_LIBRARIES)
    list(APPEND ALL_LIBRARIES ${Boost_LIBRARIES})
    link_directories(${Boost_LIBRARY_DIRS})
  endif()

endif(MITK_USE_Boost)

Set directory hints for FindBoost module in case of superbuilded boost with binary libraries.


itk_fetch_module(LabelErodeDilate
  "Classes performing morphology efficiently on label images.
  Label collisions are consistently handled, and
  operations are efficient (approximately constant time wrt
  structuring element size). Only circular/spherical/hyperspherical
  structuring elements are supported.
  http://www.insight-journal.org/browse/publication/228
  http://hdl.handle.net/10380/3399"
  GIT_REPOSITORY /home/richardb/Projects/ITK/LabelErodeDilate/
  GIT_TAG RemoteModule
  )

itk_fetch_module(LabelErodeDilate
  "Classes performing morphology efficiently on label images.
  Label collisions are consistently handled, and
  operations are efficient (approximately constant time wrt
  structuring element size). Only circular/spherical/hyperspherical
  structuring elements are supported.
  http://www.insight-journal.org/browse/publication/228
  http://hdl.handle.net/10380/3399"
  GIT_REPOSITORY https://github.com/richardbeare/LabelErodeDilate.git
  GIT_TAG 81cb83606784fff872a34a7b614a092d4fc11f92
  )

Use SHA for LabelErodeDilate module.

ENH: Use SHA for LabelErodeDilate module.

Change-Id: Ifbe76e97a012e8367acd07ccd0f7bbdcf5706515


include(FindPackageHandleStandardArgs)

find_path(SDK_INCLUDE_DIR NAMES "plugin.h" "plugincommon.h"
          PATHS ENV "SAMP_SDK_DIR"
          PATH_SUFFIXES "SDK"
          DOC "Path to SA-MP plugin SDK"
          NO_SYSTEM_ENVIRONMENT_PATH
          NO_CMAKE_SYSTEM_PATH)

find_package_handle_standard_args(SDK REQUIRED_VARS SDK_INCLUDE_DIR)

include(FindPackageHandleStandardArgs)

find_path(SDK_INCLUDE_DIR NAMES plugin.h plugincommon.h
          HINTS ${SAMP_SDK_DIR}
                ENV SAMP_SDK_DIR
                ${SDK_DIR}
                ENV SDK_DIR
          PATH_SUFFIXES sdk SDK
          DOC "Path to SA-MP plugin SDK"
          NO_SYSTEM_ENVIRONMENT_PATH
          NO_CMAKE_SYSTEM_PATH)

find_package_handle_standard_args(SDK REQUIRED_VARS SDK_INCLUDE_DIR)

Add more SDK path hints

Add more SDK path hints

FindSDK now considers the SDK_DIR and SAMP_SDK_DIR as well as corresponding
environment variables.

Also add "sdk" to PATH_SUFFIXES.


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

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

Update FW: OV9782 on RGB socket, working with OV9282 on L/R


# SPDX-License-Identifier: Apache-2.0

# See root CMakeLists.txt for description and expectations of this macro
#
# NOTE: Some GNU toolchains break with plain '-Os' or '-Og', but is fixable
# with tweaks. So allow user to override, via ifndef, the compile flags that
# CONFIG_{NO,DEBUG,SPEED,SIZE}_OPTIMIZATIONS will cause, yet still leaving the
# selection logic in kconfig.
#
# These macros leaves it up to the root CMakeLists.txt to choose the CMake
# variable names to store the optimization flags in.

macro(toolchain_cc_optimize_for_no_optimizations_flag dest_var_name)
  set_ifndef(${dest_var_name}  "-O0")
endmacro()

macro(toolchain_cc_optimize_for_debug_flag dest_var_name)
  set_ifndef(${dest_var_name}  "-Og")
endmacro()

macro(toolchain_cc_optimize_for_speed_flag dest_var_name)
  set_ifndef(${dest_var_name}  "-O2")
endmacro()

macro(toolchain_cc_optimize_for_size_flag dest_var_name)
  set_ifndef(${dest_var_name}  "-Os")
endmacro()

# SPDX-License-Identifier: Apache-2.0

# See root CMakeLists.txt for description and expectations of this macro
#
# NOTE: Some GNU toolchains break with plain '-Os' or '-Og', but is fixable
# with tweaks. So allow user to override, via ifndef, the compile flags that
# CONFIG_{NO,DEBUG,SPEED,SIZE}_OPTIMIZATIONS will cause, yet still leaving the
# selection logic in kconfig.
#
# These macros leaves it up to the root CMakeLists.txt to choose the CMake
# variable names to store the optimization flags in.

macro(toolchain_cc_optimize_for_no_optimizations_flag dest_var_name)
  set_ifndef(${dest_var_name}  "-O0")
endmacro()

macro(toolchain_cc_optimize_for_debug_flag dest_var_name)
  # -Og optimisation flag is only supported from gcc 4.8.0 and above.
  # Fall back to using -O0 flag if running an older gcc version.
  if(CMAKE_C_COMPILER_VERSION VERSION_LESS "4.8.0")
    set_ifndef(${dest_var_name}  "-O0")
  else()
    set_ifndef(${dest_var_name}  "-Og")
  endif()
endmacro()

macro(toolchain_cc_optimize_for_speed_flag dest_var_name)
  set_ifndef(${dest_var_name}  "-O2")
endmacro()

macro(toolchain_cc_optimize_for_size_flag dest_var_name)
  set_ifndef(${dest_var_name}  "-Os")
endmacro()

Add GCC -Og flag fallback to -O0.

cmake: Add GCC -Og flag fallback to -O0.

The -Og (optimise for debugging) flag is only available for GCC 4.8.0
and above, and specifying it for a GCC version lower than 4.8.0 will
result in a compilation error.

This commit adds a check for compiler -Og optimisation flag support and
a fallback to -O0 (disable optimisation) when -Og flag is unsupported.

Signed-off-by: Stephanos Ioannidis <dc76e9f0c0006e8f919e0c515c66dbba3982f785@stephanos.io>


# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(PhaseSymmetry
"Provides multi-scale steerable filters for computing phase symmetry.

For more information, see the Insight Journal article:

Hatt C.
Multi-scale Steerable Phase-Symmetry Filters for ITK
The Insight Journal. July-December. 2011.
http://hdl.handle.net/10380/3330
http://www.insight-journal.org/browse/publication/846
"
  GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/ITKPhaseSymmetry.git
  GIT_TAG 7eb2fa43a7d4d1b36307633aa4a4799b5313bedb
  )

# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(PhaseSymmetry
"Provides multi-scale steerable filters for computing phase symmetry.

For more information, see the Insight Journal article:

Hatt C.
Multi-scale Steerable Phase-Symmetry Filters for ITK
The Insight Journal. July-December. 2011.
http://hdl.handle.net/10380/3330
http://www.insight-journal.org/browse/publication/846
"
  GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/ITKPhaseSymmetry.git
  GIT_TAG 91041964bb798b16c1caa5cfef0d91f32ada8332
  )

DOC: Update PhaseSymmetry for Doxygen configuration

Changes:

 Matt McCormick (1):
   BUG: Disable the module examples since they require SEM

To fix the Doxygen build.


MESSAGE(STATUS "Checking for gnu slist")

CHECK_CXX_SOURCE_COMPILES(
	"#include <ext/slist>
	 int main(int, char**)
	 {
	   __gnu_cxx::slist<int> l;
	   return 0;
	 }" BALL_HAS_GNU_SLIST
)

IF(BALL_HAS_GNU_SLIST)
	MESSAGE(STATUS "Checking for gnu slist - Found")
ELSE()
	MESSAGE(STATUS "Checking for gnu slist - Found")
ENDIF()

MESSAGE(STATUS "Checking for gnu slist")

CHECK_CXX_SOURCE_COMPILES(
	"#include <ext/slist>
	 int main(int, char**)
	 {
	   __gnu_cxx::slist<int> l;
	   return 0;
	 }" BALL_HAS_GNU_SLIST
)

IF(BALL_HAS_GNU_SLIST)
	MESSAGE(STATUS "Checking for gnu slist - Found")
ELSE()
	MESSAGE(STATUS "Checking for gnu slist - Not found")
ENDIF()

Fix a typo in cmake slist detection

Fix a typo in cmake slist detection


itk_module(ITK-CurvatureFlow DEPENDS ITK-Common TEST_DEPENDS ITK-TestKernel)

itk_module(ITK-CurvatureFlow DEPENDS ITK-ImageFilterBase ITK-FiniteDifference TEST_DEPENDS ITK-TestKernel)

BUG: Fix module dependency of ITK-CurvatureFlow.

Change-Id: Ic26d74529c5fcab3aa1c9d6f97f9d6348e8ee4d6


TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
  LIB_REQUIRED_PACKAGES
    Kokkos
    Teuchos
    Tpetra
    Intrepid2
  LIB_REQUIRED_TPLS
    MPI
  LIB_OPTIONAL_TPLS
    BoostOrg
    Netcdf
  )

TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
  LIB_REQUIRED_PACKAGES
    Kokkos
    Teuchos
    Tpetra
    Intrepid2
  LIB_REQUIRED_TPLS
    MPI
  LIB_OPTIONAL_TPLS
    BoostOrg
    Netcdf
  TEST_OPTIONAL_TPLS
    # BoostOrg is listed twice to have -isystem added to the include directories for the TPL when compiling the tests.
    # This is a known limitation of TriBITS (c.f. https://tribits.org/doc/TribitsDevelopersGuide.html#project-name-tpl-system-include-dirs)
    BoostOrg
  )

Make TriBITS pass SYSTEM to INCLUDE_DIRECTORIES() for Boost TPL when building the tests


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

include(hunter_test_string_not_empty)

function(hunter_install_boost_config)
  hunter_test_string_not_empty("${HUNTER_SELF}")
  hunter_test_string_not_empty("${HUNTER_PACKAGE_INSTALL_PREFIX}")
  hunter_test_string_not_empty("${HUNTER_Boost_VERSION}")

  set(templates "${HUNTER_SELF}/cmake/templates")
  set(configs "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake/Boost")

  configure_file(
      "${templates}/BoostConfigVersion.cmake.in"
      "${configs}/BoostConfigVersion.cmake"
      @ONLY
  )

  configure_file(
      "${templates}/BoostConfig.cmake.in"
      "${configs}/BoostConfig.cmake"
      @ONLY
  )

  if(BOOST_CONFIG_LINK_ZLIB)
    configure_file(
        "${templates}/BoostZLIBDependency.cmake.in"
        "${configs}/BoostZLIBDependency.cmake"
        @ONLY
    )
  endif()

  if(BOOST_CONFIG_LINK_BZIP2)
    configure_file(
        "${templates}/BoostBZIP2Dependency.cmake.in"
        "${configs}/BoostBZIP2Dependency.cmake"
        @ONLY
    )
  endif()
endfunction()

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

include(hunter_test_string_not_empty)

function(hunter_install_boost_config)
  hunter_test_string_not_empty("${HUNTER_SELF}")
  hunter_test_string_not_empty("${HUNTER_PACKAGE_INSTALL_PREFIX}")
  hunter_test_string_not_empty("${HUNTER_Boost_VERSION}")

  set(templates "${HUNTER_SELF}/cmake/templates")
  set(configs "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake/Boost")

  configure_file(
      "${templates}/BoostConfigVersion.cmake.in"
      "${configs}/BoostConfigVersion.cmake"
      @ONLY
  )

  configure_file(
      "${templates}/BoostConfig.cmake.in"
      "${configs}/BoostConfig.cmake"
      @ONLY
  )

  if(BOOST_CONFIG_LINK_ZLIB)
    configure_file(
        "${templates}/BoostZLIBDependency.cmake.in"
        "${configs}/BoostZLIBDependency.cmake"
        @ONLY
    )
  endif()

  if(BOOST_CONFIG_LINK_BZIP2)
    configure_file(
        "${templates}/BoostBZip2Dependency.cmake.in"
        "${configs}/BoostBZip2Dependency.cmake"
        @ONLY
    )
  endif()
endfunction()

Fix incorrect case of Boost dep BZip2

Fix incorrect case of Boost dep BZip2


# Set GIT tag here for use in multiple CMakeLists.txt
#
set(DCMTK_GIT_REPOSITORY "https://github.com/InsightSoftwareConsortium/DCMTK.git")
# 2018.01.16 patched
# Patch list:
# COMP: Uses ITK PNG instead of system PNG
# BUG: when using ITK_ZLIB, wasn't finding zlib header
# COMP: Set 3rd party package CMake variables only if needed
# COMP: Mods to allow using ITK libs
# Support CMAKE_CROSSCOMPILING_EMULATOR
# Support the generation of arith.h with Emscription
# Do not use non-type template argument -1 in variadic template

set(DCMTK_GIT_TAG "14393c0baa743469b5826bea724c048e221dd08b") # 20200215 master

# Set GIT tag here for use in multiple CMakeLists.txt
#
set(DCMTK_GIT_REPOSITORY "https://github.com/InsightSoftwareConsortium/DCMTK.git")
# 2020.02.14 patched
# Patch list:

 #Francois Budin (1):
       #COMP: Uses ITK PNG instead of system PNG

 #Hans Johnson (1):
       #COMP: Mods to allow using ITK libs

 #Jean-Christophe Fillion-Robin (1):
       #COMP: Set 3rd party package CMake variables only if needed

 #Matt McCormick (2):
       #Support CMAKE_CROSSCOMPILING_EMULATOR
       #Support the generation of arith.h with Emscription

set(DCMTK_GIT_TAG "972d43e13acde08c186f6e02816b18d2fbaba4cc") # 20200214_DCMTK_PATCHES_FOR_ITK

Add ITK patches for DCMTK

COMP: Add ITK patches for DCMTK

These are required to use the name-mangled ITK internal third party
libraries and add Emscripten support.


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

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

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

if(BUILD_TESTING)

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

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

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

else()

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

endif(BUILD_TESTING)

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

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

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

if(BUILD_TESTING)

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

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

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

else()

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

endif(BUILD_TESTING)

Update MITK Data revision tag

Update MITK Data revision tag


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.


set(OCTOMAP_LIBPATH
	/opt/ros/indigo/lib
	/usr/lib
	/usr/local/lib)

find_library(OCTOMAP_LIBRARY octomap
	PATH ${OCTOMAP_LIBPATH})
message("Find octomap lib ${OCTOMAP_LIBRARY}")

find_library(OCTOMAP_OCTOMATH_LIBRARY octomath
	PATH ${OCTOMAP_LIBPATH})
message("Find octomath lib ${OCTOMAP_OCTOMATH_LIBRARY}")

set(OCTOMAP_LIBRARIES
	${OCTOMAP_LIBRARY}
	${OCTOMAP_OCTOMATH_LIBRARY}
)

INCLUDE (CheckIncludeFiles)

find_path(OCTOMAP_INCLUDE_DIR octomap/octomap.h
	PATH /usr/include /opt/ros/indigo/include
	/usr/local/include
)

if (OCTOMAP_LIBRARY AND OCTOMAP_INCLUDE_DIR)
	set(OCTOMAP_FOUND TRUE)
endif (OCTOMAP_LIBRARY AND OCTOMAP_INCLUDE_DIR)

if ( OCTOMAP_FOUND )
	message(STATUS "Found Octomap at ${OCTOMAP_LIBRARY}")
else ( OCTOMAP_FOUND )
	message(STATUS "Octomap not found")
endif ( OCTOMAP_FOUND )

set(OCTOMAP_LIBPATH
	/opt/ros/indigo/lib
	/usr/lib
	/usr/local/lib)

find_library(OCTOMAP_LIBRARY octomap
	PATH ${OCTOMAP_LIBPATH})
message("-- Find octomap lib ${OCTOMAP_LIBRARY}")

find_library(OCTOMAP_OCTOMATH_LIBRARY octomath
	PATH ${OCTOMAP_LIBPATH})
message("-- Find octomath lib ${OCTOMAP_OCTOMATH_LIBRARY}")

set(OCTOMAP_LIBRARIES
	${OCTOMAP_LIBRARY}
	${OCTOMAP_OCTOMATH_LIBRARY}
)

INCLUDE (CheckIncludeFiles)

find_path(OCTOMAP_INCLUDE_DIR octomap/octomap.h
	PATH /usr/include /opt/ros/indigo/include
	/usr/local/include
)

if (OCTOMAP_LIBRARY AND OCTOMAP_INCLUDE_DIR)
	set(OCTOMAP_FOUND TRUE)
endif (OCTOMAP_LIBRARY AND OCTOMAP_INCLUDE_DIR)

if ( OCTOMAP_FOUND )
	message(STATUS "Found Octomap at ${OCTOMAP_LIBRARY}")
else ( OCTOMAP_FOUND )
	message(STATUS "Octomap not found")
endif ( OCTOMAP_FOUND )

Use the same print style as everything else.


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

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

# "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 "3632be26e225b8078b2ce91f02910e32f478f7a2")

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

Update FW with stereo fixes for instance number; RGB depth alignment


# This file is a part of the OpenSurgSim project.
# Copyright 2012-2013, SimQuest Solutions Inc.

# - Try to find the Google Mock Source directory
#
# Once done this will define
#  GOOGLEMOCK_FOUND
#  GOOGLEMOCK_DIR
#

if(NOT GOOGLEMOCK_DIR)
	find_path(GOOGLEMOCK_DIR
		NAMES src/gmock.cc
		PATHS "$ENV{GOOGLEMOCK_DIR}" "/usr/src/gmock/"
	)
endif(NOT GOOGLEMOCK_DIR)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GoogleMock DEFAULT_MSG GOOGLEMOCK_DIR)

mark_as_advanced(GOOGLEMOCK_DIR)

# This file is a part of the OpenSurgSim project.
# Copyright 2014, SimQuest Solutions 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.

# - Try to find the Google Mock Source directory
#
# Once done this will define
#  GOOGLEMOCK_FOUND
#  GOOGLEMOCK_DIR
#

if(NOT GOOGLEMOCK_DIR)
	find_path(GOOGLEMOCK_DIR
		NAMES src/gmock.cc
		PATHS "$ENV{GOOGLEMOCK_DIR}" "/usr/src/gmock/"
	)
endif(NOT GOOGLEMOCK_DIR)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GoogleMock DEFAULT_MSG GOOGLEMOCK_DIR)

mark_as_advanced(GOOGLEMOCK_DIR)

Add License to FindGoolgMock.cmake file

Add License to FindGoolgMock.cmake file


# guard against in-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
    message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
endif()

# guard against bad build-type strings
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Debug")
endif()

string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper)
if(    NOT cmake_build_type_tolower STREQUAL "debug"
   AND NOT cmake_build_type_tolower STREQUAL "release"
   AND NOT cmake_build_type_tolower STREQUAL "profile"
   AND NOT cmake_build_type_tolower STREQUAL "relwithdebinfo")
      message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, Profile, RelWithDebInfo (case-insensitive).")
endif()

# guard against in-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
    message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
endif()

# guard against bad build-type strings
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Debug")
endif()

string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper)
if(    NOT cmake_build_type_tolower STREQUAL "debug"
   AND NOT cmake_build_type_tolower STREQUAL "release"
   AND NOT cmake_build_type_tolower STREQUAL "profile"
   AND NOT cmake_build_type_tolower STREQUAL "relwithdebinfo"
   AND NOT cmake_build_type_tolower STREQUAL "coverage")
      message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Coverage, Release, Profile, RelWithDebInfo (case-insensitive).")
endif()

Include Coverage as allowed build type.

Include Coverage as allowed build type.


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

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

include(polly_add_cache_flag)

polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "/permissive-")

# There is no macro to detect this flags on toolchain calculation so we must
# mark this toolchain explicitly.
list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "/permissive-")

Fix "No newline at end of file" warning

Fix "No newline at end of file" warning


set(DOCUMENTATION "This module contains classes to iterate over images in the frequency domain,
and filters to apply band pass filters based on frequency.

A more detailed description can be found in the Insight Journal article::

Cerdan, P.H. \"ITK Wavelet Module\".
  http://hdl.handle.net/10380/3558
  September, 2016.
")

itk_module(ITKImageFrequency
  DEPENDS
    ITKCommon
  TEST_DEPENDS
    ITKTestKernel
    ITKImageIntensity
  # EXCLUDE_FROM_DEFAULT
  DESCRIPTION
  "${DOCUMENTATION}"
  )

set(DOCUMENTATION "This module contains classes to iterate over images in the frequency domain,
and filters to apply band pass filters based on frequency.

A more detailed description can be found in the Insight Journal article::

Cerdan, P.H. \"ITK Wavelet Module\".
  http://hdl.handle.net/10380/3558
  September, 2016.
")

itk_module(ITKImageFrequency
  DEPENDS
    ITKCommon
  TEST_DEPENDS
    ITKTestKernel
    ITKImageIntensity
  DESCRIPTION
  "${DOCUMENTATION}"
  )

STYLE: Remove comment in ITKImageFrequency cmake

Change-Id: I6247401f635348e69d0457c040d155a55943a7ba