# Required
message(STATUS "Looking for required Boost headers")

# Mandatory components
# - date_time -> ossim plugins
set(OTB_Boost_COMPONENTS date_time)
# Optional components
# Boost (OPTIONAL_COMPONENTS does not work with Boost find_package)
# unit_test_framework component is used only in GdalAdapters module
if (BUILD_TESTING)
  list(APPEND OTB_Boost_COMPONENTS unit_test_framework)
endif()

#Quiet find package to avoid message "Could not find boost" because unit_testing_framework is not installed
#message(STATUS "Looking for optional Boost components : ${OTB_Boost_OPTIONAL_COMPONENTS}")
find_package ( Boost
  REQUIRED
  1.35.0
  COMPONENTS ${OTB_Boost_COMPONENTS}
  )

# Required
message(STATUS "Looking for required Boost headers")
find_package ( Boost
  1.35.0
  REQUIRED
  )

# Optional components
# Boost (OPTIONAL_COMPONENTS does not work with Boost find_package)
# unit_test_framework component is used only in GdalAdapters module
if (BUILD_TESTING)
  set(OTB_Boost_OPTIONAL_COMPONENTS unit_test_framework)
  message(STATUS "Looking for optional Boost components : ${OTB_Boost_OPTIONAL_COMPONENTS}")
  find_package ( Boost
    QUIET
    1.35.0
    COMPONENTS ${OTB_Boost_OPTIONAL_COMPONENTS}
    )
endif()

Revert "COMP: update find_package for boost"

This reverts commit e883243c2f4b728699e45e1930301acb0acbeeb6.


set(enabled_modules
  Core
  CppMicroServices
  DICOM
  DICOMPM
  DataTypesExt
  AlgorithmsExt
  DICOMQI
  Multilabel
  SceneSerializationBase
  DICOMPMIO
  DICOMImageIO
  ContourModel
  DICOMSegIO
  LegacyGL
  MapperExt
  SceneSerialization
  LegacyIO
  IOExt
  MultilabelIO
  AppUtil
  QtWidgets
  QtWidgetsExt
  Segmentation
  SegmentationUI
  PlanarFigure
  Annotation
  SurfaceInterpolation
  GraphAlgorithms
  ImageExtraction
  ImageStatistics
)

set(enabled_plugins
org.blueberry.core.commands
org.blueberry.core.expressions
org.blueberry.core.runtime
org.blueberry.ui.qt
org.blueberry.ui.qt.help
org.blueberry.ui.qt.log
org.mitk.core.ext
org.mitk.core.services
org.mitk.gui.common
org.mitk.gui.qt.application
org.mitk.gui.qt.common
org.mitk.gui.qt.datamanager
org.mitk.gui.qt.flow.segmentation
org.mitk.gui.qt.flowapplication
org.mitk.gui.qt.imagenavigator
org.mitk.gui.qt.multilabelsegmentation
org.mitk.gui.qt.properties
org.mitk.gui.qt.segmentation
org.mitk.gui.qt.stdmultiwidgeteditor
org.mitk.planarfigure
)

set(enabled_modules
  Core
  CppMicroServices
  DICOM
  DICOMPM
  DataTypesExt
  AlgorithmsExt
  DICOMQI
  Multilabel
  SceneSerializationBase
  DICOMPMIO
  DICOMImageIO
  ContourModel
  DICOMSegIO
  LegacyGL
  MapperExt
  SceneSerialization
  LegacyIO
  IOExt
  MultilabelIO
  AppUtil
  QtWidgets
  QtWidgetsExt
  Segmentation
  SegmentationUI
  PlanarFigure
  Annotation
  SurfaceInterpolation
  GraphAlgorithms
  ImageExtraction
  ImageStatistics
)

set(enabled_plugins
org.blueberry.core.commands
org.blueberry.core.expressions
org.blueberry.core.runtime
org.blueberry.ui.qt
org.blueberry.ui.qt.help
org.blueberry.ui.qt.log
org.mitk.core.ext
org.mitk.core.services
org.mitk.gui.common
org.mitk.gui.qt.application
org.mitk.gui.qt.common
org.mitk.gui.qt.datamanager
org.mitk.gui.qt.ext
org.mitk.gui.qt.flow.segmentation
org.mitk.gui.qt.flowapplication
org.mitk.gui.qt.imagenavigator
org.mitk.gui.qt.multilabelsegmentation
org.mitk.gui.qt.properties
org.mitk.gui.qt.segmentation
org.mitk.gui.qt.stdmultiwidgeteditor
org.mitk.planarfigure
)

Add org.mitk.gui.qt.ext plugin to whitelist


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

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

Update SCIOFIO to ITKv4.13 branch

BUG: Update SCIOFIO to ITKv4.13 branch

This patch includes updates to support multiple downloads locations
which are replacing gerrit.

Change-Id: I708a7a94397a41b1e222927cd4c51ea7a3e1903f


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

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

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

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

Update device side FW with updated mdk

Update device side FW with updated mdk


include(CMakeFindDependencyMacro)

find_dependency(QtOlm)
include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake")

include(CMakeFindDependencyMacro)

if (Quotient_E2EE_ENABLED)
    find_dependency(QtOlm)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake")

Fix building tests without E2EE

Fix building tests without E2EE


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

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

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

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

Update FW: configurable FPS for OV7251: max 99 for 480p, 117 for 400p


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

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

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

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

Update FW: fix still capture with scaling, add FPS capping (with warnings)


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

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

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

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

Update FW, bugfix for config_h2d handling after initial setup


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

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

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

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

Update FW with memory optimizations

Update FW with memory optimizations


#---------------------------------------------------------------------------
# Get and build itk

if( NOT ITK_TAG )
  set( ITK_TAG "v4.2.1" )
endif()

ExternalProject_Add( ITK
  GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git"
  GIT_TAG "${ITK_TAG}"
  SOURCE_DIR ITK
  BINARY_DIR ITK-build
  CMAKE_GENERATOR ${gen}
  CMAKE_ARGS
    ${ep_common_args}
    -DBUILD_SHARED_LIBS:BOOL=ON
    -DBUILD_EXAMPLES:BOOL=OFF
    -DBUILD_TESTING:BOOL=OFF
    -DITK_BUILD_ALL_MODULES:BOOL=ON
#    -DVTK_DIR:PATH=${VTK_DIR}
#    -DModule_ITKVtkGlue:BOOL=ON
    -DITK_USE_REVIEW:BOOL=ON
  INSTALL_COMMAND ""
#  DEPENDS VTK
)

set(ITK_DIR ${CMAKE_BINARY_DIR}/ITK-build)

#---------------------------------------------------------------------------
# Get and build itk

if( NOT ITK_TAG )
  set( ITK_TAG "v4.2.1" )
endif()

ExternalProject_Add( ITK
  GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git"
  GIT_TAG "${ITK_TAG}"
  SOURCE_DIR ITK
  BINARY_DIR ITK-build
  CMAKE_GENERATOR ${gen}
  CMAKE_ARGS
    ${ep_common_args}
    -DBUILD_SHARED_LIBS:BOOL=OFF
    -DBUILD_EXAMPLES:BOOL=OFF
    -DBUILD_TESTING:BOOL=OFF
    -DITK_BUILD_ALL_MODULES:BOOL=ON
#    -DVTK_DIR:PATH=${VTK_DIR}
#    -DModule_ITKVtkGlue:BOOL=ON
    -DITK_USE_REVIEW:BOOL=ON
  INSTALL_COMMAND ""
#  DEPENDS VTK
)

set(ITK_DIR ${CMAKE_BINARY_DIR}/ITK-build)

COMP: Set superbuild ITK BUILD_SHARED_LIBS OFF.

The tests had a hard time finding the libraries on Windows.


# This CMake script may be used
# with a command line like
# cmake -DWDIR:PATH=<workdir_path> -DODIR:PATH=<output_path> -P CreatePatchCVS.cmake
#
# The script will
#   1) find an appropriate cvs command.
#   2) create a unified diff from CVS diff command
#      rooted at WDIR and put the resulting diff
#      in ODIR/patch.diff
FIND_PROGRAM(CVS_COMMAND
             NAMES cvs
             DOC "The command line cvs command")

# TODO: -kk doesn't work, googling only reports a few unsolved problem reports.
SET(CVS_DIFF_ARGS "diff -u")
MESSAGE(STATUS "CVS Patch:: Generating patch using CVS...")
MESSAGE(STATUS "CVS Patch:: Using command     : ${CVS_COMMAND} ${CVS_DIFF_ARGS}")
MESSAGE(STATUS "CVS Patch:: Rooted at Workdir : ${WDIR}")
EXECUTE_PROCESS(COMMAND ${CVS_COMMAND} ${CVS_DIFF_ARGS}
                OUTPUT_FILE ${ODIR}/patch.diff
                RESULT_VARIABLE PATCHOK
                WORKING_DIRECTORY ${WDIR}
                ERROR_QUIET)
MESSAGE(STATUS "CVS Patch:: Patch file is : ${ODIR}/patch.diff")

# This CMake script may be used
# with a command line like
# cmake -DWDIR:PATH=<workdir_path> -DODIR:PATH=<output_path> -P CreatePatchCVS.cmake
#
# The script will
#   1) find an appropriate cvs command.
#   2) create a unified diff from CVS diff command
#      rooted at WDIR and put the resulting diff
#      in ODIR/patch.diff
FIND_PROGRAM(CVS_COMMAND
             NAMES cvs
             DOC "The command line cvs command")

# TODO: -kk doesn't work, googling only reports a few unsolved problem reports.
SET(CVS_DIFF_ARGS "diff -u")
MESSAGE(STATUS "CVS Patch:: Generating patch using CVS...")
MESSAGE(STATUS "CVS Patch:: Using command     : ${CVS_COMMAND} ${CVS_DIFF_ARGS}")
MESSAGE(STATUS "CVS Patch:: Rooted at Workdir : ${WDIR}")
EXECUTE_PROCESS(COMMAND ${CVS_COMMAND} diff -u
                OUTPUT_FILE ${ODIR}/patch.diff
                RESULT_VARIABLE PATCHOK
                WORKING_DIRECTORY ${WDIR}
                ERROR_QUIET)
IF(PATCHOK)
    MESSAGE(STATUS "CVS Patch:: Patch file is : ${ODIR}/patch.diff")
ELSE(PATCHOK)
    MESSAGE(SEND_ERROR "CVS Patch:: FAILED")
ENDIF(PATCHOK)

Fix trouble with execute process command arguments


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

find_path(VIZ_INCLUDE_DIR "viz" HINTS "${CMAKE_CURRENT_LIST_DIR}/../include/" )
find_library(VIZ_LIBRARY NAMES VIZ HINTS "${CMAKE_CURRENT_LIST_DIR}/../lib/")

set(VIZ_LIBRARIES ${VIZ_LIBRARY} )
set(VIZ_INCLUDE_DIRS ${VIZ_INCLUDE_DIR} )

message(STATUS "VIZ found")
message(STATUS "  includes: " ${VIZ_INCLUDE_DIRS})
message(STATUS "  libs: " ${VIZ_LIBRARIES} )

Add debug info for cmake

Add debug info for cmake


# Insight Journal Handle: https://hdl.handle.net/10380/3460
# Contact: Alexander Schmidt-Richberg <a.schmidt-richberg@imperial.ac.uk>
#          Jan Ehrhardt <ehrhardt@imi.uni-luebeck.de>
#          Rene Werner <r.werner@uke.de>
itk_fetch_module(VariationalRegistration
  "A module to perform variational image registration. https://hdl.handle.net/10380/3460"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKVariationalRegistration.git
  GIT_TAG 5110f1b4304f450b46bbbaf0f3818a4bac65b154
  )

# Insight Journal Handle: https://hdl.handle.net/10380/3460
# Contact: Alexander Schmidt-Richberg <a.schmidt-richberg@imperial.ac.uk>
#          Jan Ehrhardt <ehrhardt@imi.uni-luebeck.de>
#          Rene Werner <r.werner@uke.de>
itk_fetch_module(VariationalRegistration
  "A module to perform variational image registration. https://hdl.handle.net/10380/3460"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKVariationalRegistration.git
  GIT_TAG 5c6fb14e84ad27a38d1a794f0b279ad3190484b3
  )

COMP: Fix VariationalRegistration for future const GetMacro support

Minor const adherance needed for compiling with
future removal of deprecated interfaces.

Change-Id: Ie266a0e5a65705b6364cd80f7f244eb18d65a74c


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

# Version info

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

include(sitkSourceVersion)

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

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

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

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

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

# Version info

set(SimpleITK_VERSION_MAJOR 2)
set(SimpleITK_VERSION_MINOR 0)
set(SimpleITK_VERSION_PATCH 2)
#set(SimpleITK_VERSION_TWEAK "")

include(sitkSourceVersion)

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

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

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

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

Update release version to 2.0.2

Update release version to 2.0.2


#.rst:
# FindVisionaray
# --------------
#
# Find the Visionaray ray tracing library
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# VISIONARAY_INCLUDE_DIR - include directories of Visionaray
# VISIONARAY_LIBRARIES - libraries to link against Visionaray
# VISIONARAY_FOUND - true if Visionaray has been found and can be used

include(FindPackageHandleStandardArgs)

set(paths
    /usr
    /usr/local
)

find_path(VISIONARAY_INCLUDE_DIR
    NAMES
        scheduler.h # TODO: sure?
    PATHS
        ${paths}
    PATH_SUFFIXES
        include
        include/visionaray
)

find_library(VISIONARAY_LIBRARY
    NAMES
        visionaray
    PATHS
        ${paths}
    PATH_SUFFIXES
        lib64
        lib
)

set(VISIONARAY_LIBRARIES ${VISIONARAY_LIBRARY})

find_package_handle_standard_args(Visionaray
    DEFAULT_MSG
    VISIONARAY_INCLUDE_DIR
    VISIONARAY_LIBRARY
)

Add some documentation to the cmake find module


IF(APPLE)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
ELSEIF (WIN32 OR UNIX)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ENDIF(APPLE)

ADD_BII_TARGETS()

IF(APPLE)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
ELSEIF (WIN32 OR UNIX)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ENDIF(APPLE)

SET(BII_LIB_TYPE SHARED)

ADD_BII_TARGETS()

Make Bii generate dynamic library

Make Bii generate dynamic library


#.rst:
# FindLuaInterp
# --------
#
# Find Lua Interpreter
#
# ::
#
#   LUA_EXECUTABLE     - the full path to lua
#   LUA_EXECUTABLE_FOUND          - If false, don't attempt to use lua
#   LUA_EXECUTABLE_VERSION_STRING - version of lua found

find_program(LUA_EXECUTABLE
  NAMES lua
  )

if(LUA_EXECUTABLE)
  ### LUA_VERSION
  execute_process(
    COMMAND ${LUA_EXECUTABLE} -v
    OUTPUT_VARIABLE
      LUA_EXECUTABLE_VERSION_STRING
    ERROR_VARIABLE
      LUA_EXECUTABLE_VERSION_STRING
    RESULT_VARIABLE
      LUA_VERSION_RESULT_VARIABLE
    OUTPUT_STRIP_TRAILING_WHITESPACE
    ERROR_STRIP_TRAILING_WHITESPACE
    )
  if (NOT LUA_VERSION_RESULT_VARIABLE)
    string( REGEX MATCH "([0-9]*)([.])([0-9]*)([.]*)([0-9]*)"
      LUA_EXECUTABLE_VERSION
      ${LUA_EXECUTABLE_VERSION_STRING} )
  endif()
endif()

# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LuaInterp
                                  REQUIRED_VARS LUA_EXECUTABLE
                                  VERSION_VAR LUA_VERSION_STRING)

mark_as_advanced(LUA_EXECUTABLE)

#.rst:
# FindLuaInterp
# --------
#
# Find Lua Interpreter
#
# ::
#
#   LUA_EXECUTABLE     - the full path to lua
#   LUA_EXECUTABLE_FOUND          - If false, don't attempt to use lua
#   LUA_EXECUTABLE_VERSION_STRING - version of lua found

set(_NAMES lua)

if(NOT LuaInterp_FIND_VERSION_MAJOR EQUAL 0)
  list(INSERT _NAMES 0 lua${LuaInterp_FIND_VERSION_MAJOR})
  if(NOT LuaInterp_FIND_VERSION_MINOR EQUAL 0)
    list(INSERT _NAMES 0 lua${LuaInterp_FIND_VERSION_MAJOR}.${LuaInterp_FIND_VERSION_MINOR})
  endif()
endif()

find_program(LUA_EXECUTABLE
  NAMES ${_NAMES}
  )

if(LUA_EXECUTABLE)
  ### LUA_VERSION
  execute_process(
    COMMAND ${LUA_EXECUTABLE} -v
    OUTPUT_VARIABLE
      LUA_EXECUTABLE_VERSION_STRING
    ERROR_VARIABLE
      LUA_EXECUTABLE_VERSION_STRING
    RESULT_VARIABLE
      LUA_VERSION_RESULT_VARIABLE
    OUTPUT_STRIP_TRAILING_WHITESPACE
    ERROR_STRIP_TRAILING_WHITESPACE
    )
  if (NOT LUA_VERSION_RESULT_VARIABLE)
    string( REGEX MATCH "([0-9]*)([.])([0-9]*)([.]*)([0-9]*)"
      LUA_EXECUTABLE_VERSION
      ${LUA_EXECUTABLE_VERSION_STRING} )
  endif()
endif()

# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LuaInterp
                                  REQUIRED_VARS LUA_EXECUTABLE
                                  VERSION_VAR LUA_VERSION_STRING)

mark_as_advanced(LUA_EXECUTABLE)

Include version suffix in lua executable search


###########################################################################
# Figure out what platform we're on, and set some variables appropriately

message (STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
message (STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}")
message (STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")

if (UNIX)
    message (STATUS "Unix! ${CMAKE_SYSTEM_NAME}")
    if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
        set (platform "linux")
        set (CXXFLAGS "${CXXFLAGS} -DLINUX")
        if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
            set (platform "linux64")
            set (CXXFLAGS "${CXXFLAGS} -DLINUX64")
        endif ()
    endif ()
    if (APPLE)
        message (STATUS "Apple!")
        set (platform "macosx")
    endif ()
endif ()

if (WIN32)
    message (STATUS "Windows!")
    set (platform "windows")
endif ()

if (platform)
    message (STATUS "platform = ${platform}")
else ()
    message (FATAL_ERROR "'platform' not defined")
endif ()

###########################################################################
# Figure out what platform we're on, and set some variables appropriately

# CMAKE_SYSTEM_PROCESSOR should not be used because it indicates the platform
# we are building on, but when cross compiling or using a chroot this is not
# what we want to use
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
    set (SYSTEM_PROCESSOR "x86_64")
else()
    set (SYSTEM_PROCESSOR "i686")
endif()

message (STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
message (STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}")
message (STATUS "SYSTEM_PROCESSOR = ${SYSTEM_PROCESSOR}")

if (UNIX)
    message (STATUS "Unix! ${CMAKE_SYSTEM_NAME}")
    if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
        set (platform "linux")
        set (CXXFLAGS "${CXXFLAGS} -DLINUX")
        if (${SYSTEM_PROCESSOR} STREQUAL "x86_64")
            set (platform "linux64")
            set (CXXFLAGS "${CXXFLAGS} -DLINUX64")
        endif ()
    endif ()
    if (APPLE)
        message (STATUS "Apple!")
        set (platform "macosx")
    endif ()
endif ()

if (WIN32)
    message (STATUS "Windows!")
    set (platform "windows")
endif ()

if (platform)
    message (STATUS "platform = ${platform}")
else ()
    message (FATAL_ERROR "'platform' not defined")
endif ()

unset(SYSTEM_PROCESSOR)

Fix for building from a chroot where the host may be e.g. 64 bit and the target is 32 bit, we can't use CMAKE_SYSTEM_PROCESSOR and need to ask the compiler.


# -*- cmake -*-

include(Prebuilt)

set(JSONCPP_FIND_QUIETLY ON)
set(JSONCPP_FIND_REQUIRED ON)

if (STANDALONE)
  include(FindJsonCpp)
else (STANDALONE)
  use_prebuilt_binary(jsoncpp)
  if (WINDOWS)
    set(JSONCPP_LIBRARIES
      debug json_vc100debug_libmt.lib
      optimized json_vc100_libmt)
  elseif (DARWIN)
    set(JSONCPP_LIBRARIES libjson_darwin_libmt.a)
  elseif (LINUX)
    set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
  endif (WINDOWS)
  set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
endif (STANDALONE)

# -*- cmake -*-

include(Prebuilt)

set(JSONCPP_FIND_QUIETLY ON)
set(JSONCPP_FIND_REQUIRED ON)

if (STANDALONE)
  include(FindJsonCpp)
else (STANDALONE)
  use_prebuilt_binary(jsoncpp)
  if (WINDOWS)
    set(JSONCPP_LIBRARIES
      debug json_vc100debug_libmt.lib
      optimized json_vc100_libmt)
  elseif (DARWIN)
    set(JSONCPP_LIBRARIES libjson_darwin_libmt.a)
  elseif (LINUX)
    if (ND_BUILD64BIT_ARCH)
      set(JSONCPP_LIBRARIES libjson_linux-gcc-4.4.7_libmt.a)
    else (ND_BUILD64BIT_ARCH)
      set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
    endif (ND_BUILD64BIT_ARCH
  endif (WINDOWS)
  set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
endif (STANDALONE)

Use correct library on 64-bit Linux.

FIRE-13896: Use correct library on 64-bit Linux.


# Find and set Boost flags

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

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

# Find and set Boost flags

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

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

Fix: Boost filesystem v3 are supported starting 1.44 only

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


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

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

Update ITK CMake version for 5.1.2

ENH: Update ITK CMake version for 5.1.2


# No special flags are needed for xcc.
# Only select whether gcc or clang flags should be inherited.
if(CC STREQUAL "clang")
  include(${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake)

  # Now, let's overwrite the flags that are different in xcc/clang.
  if($ENV{XCC_NO_G_FLAG})
    # Older xcc/clang cannot use "-g" due to this bug:
    # https://bugs.llvm.org/show_bug.cgi?id=11740.
    # Clear the related flag(s) here so it won't cause issues.
    set_compiler_property(PROPERTY debug)
  endif()
else()
  include(${ZEPHYR_BASE}/cmake/compiler/gcc/compiler_flags.cmake)

  # XCC is based on GCC 4.2 which has a somewhat pedantic take on the
  # fact that linkage semantics differed between C99 and GNU at the
  # time.  Suppress the warning, it's the best we can do given that
  # it's a legacy compiler.
  set_compiler_property(APPEND PROPERTY warning_base "-fgnu89-inline")
endif()

# No special flags are needed for xcc.
# Only select whether gcc or clang flags should be inherited.
if(CC STREQUAL "clang")
  include(${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake)

  # Now, let's overwrite the flags that are different in xcc/clang.
  if($ENV{XCC_NO_G_FLAG})
    # Older xcc/clang cannot use "-g" due to this bug:
    # https://bugs.llvm.org/show_bug.cgi?id=11740.
    # Clear the related flag(s) here so it won't cause issues.
    set_compiler_property(PROPERTY debug)
  endif()
else()
  include(${ZEPHYR_BASE}/cmake/compiler/gcc/compiler_flags.cmake)

  # XCC is based on GCC 4.2 which has a somewhat pedantic take on the
  # fact that linkage semantics differed between C99 and GNU at the
  # time.  Suppress the warning, it's the best we can do given that
  # it's a legacy compiler.
  set_compiler_property(APPEND PROPERTY warning_base "-fgnu89-inline")

  set_compiler_property(PROPERTY warning_error_misra_sane)
endif()

Remove -Werror flag unknown to XCC

compiler/xcc: Remove -Werror flag unknown to XCC

XCC (based on GCC 4.2) doesn't recognize -Wvla (for variable-length
array), so remove it from "warning_error_misra_sane" property.

Signed-off-by: Ederson de Souza <1da3dd06fbb9d545ec21e96bca6ffa5cba52ede5@intel.com>


configure_file(${CMAKE_CURRENT_LIST_DIR}/GoogleTest-CMakeLists.txt.in
               ${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
  RESULT_VARIABLE result
  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download
)
if(result)
  message(FATAL_ERROR "Running CMake for Google Test failed: ${result}")
endif()

execute_process(COMMAND ${CMAKE_COMMAND} --build .
  RESULT_VARIABLE result
  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download
)
if(result)
  message(FATAL_ERROR "Downloading Google Test failed: ${result}")
endif()

# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

add_subdirectory(${GTEST_SOURCE_DIR}/googlemock ${GTEST_BINARY_DIR} EXCLUDE_FROM_ALL)
mark_as_advanced(FORCE
                 BUILD_SHARED_LIBS
                 gmock_build_tests
                 gtest_build_samples
                 gtest_build_tests
                 gtest_disable_pthreads
                 gtest_force_shared_crt
                 gtest_hide_internal_symbols)

Hide Google Test variables by default.

CMake: Hide Google Test variables by default.


# -*- cmake -*-

if(INSTALL_PROPRIETARY)
  include(Prebuilt)
  use_prebuilt_binary(quicktime)
endif(INSTALL_PROPRIETARY)

if (DARWIN)
  include(CMakeFindFrameworks)
  find_library(QUICKTIME_LIBRARY QuickTime)
elseif (WINDOWS)
  set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK"
      CACHE PATH "Location of the QuickTime SDK.")

  find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient
               PATHS
               ${ARCH_PREBUILT_DIRS_DEBUG}
               "${QUICKTIME_SDK_DIR}\\libraries"
               )

  find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient
               PATHS
               ${ARCH_PREBUILT_DIRS_RELEASE}
               "${QUICKTIME_SDK_DIR}\\libraries"
               )

  if (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
    set(QUICKTIME_LIBRARY
        optimized ${RELEASE_QUICKTIME_LIBRARY}
        debug ${DEBUG_QUICKTIME_LIBRARY}
        )

  endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)

  include_directories(
    ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/quicktime
    "${QUICKTIME_SDK_DIR}\\CIncludes"
    )
endif (DARWIN)

mark_as_advanced(QUICKTIME_LIBRARY)

if (QUICKTIME_LIBRARY)
  set(QUICKTIME ON CACHE BOOL "Build with QuickTime streaming media support.")
endif (QUICKTIME_LIBRARY)

# -*- cmake -*-

if(INSTALL_PROPRIETARY)
  include(Prebuilt)
  use_prebuilt_binary(quicktime)
endif(INSTALL_PROPRIETARY)

if (DARWIN)
  include(CMakeFindFrameworks)
  find_library(QUICKTIME_LIBRARY QuickTime)
elseif (WINDOWS)
  set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK"
      CACHE PATH "Location of the QuickTime SDK.")

  find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient.lib
               PATHS
               ${ARCH_PREBUILT_DIRS_DEBUG}
               "${QUICKTIME_SDK_DIR}\\libraries"
               )

  find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient.lib
               PATHS
               ${ARCH_PREBUILT_DIRS_RELEASE}
               "${QUICKTIME_SDK_DIR}\\libraries"
               )

  if (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
    set(QUICKTIME_LIBRARY
        optimized ${RELEASE_QUICKTIME_LIBRARY}
        debug ${DEBUG_QUICKTIME_LIBRARY}
        )

  endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)

  include_directories(
    ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/quicktime
    "${QUICKTIME_SDK_DIR}\\CIncludes"
    )
endif (DARWIN)

mark_as_advanced(QUICKTIME_LIBRARY)

if (QUICKTIME_LIBRARY)
  set(QUICKTIME ON CACHE BOOL "Build with QuickTime streaming media support.")
endif (QUICKTIME_LIBRARY)

Fix for DEV-41797 - "LL_QUICKTIME_ENABLED is often unset on Windows builds"


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

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

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

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

Update FW, fix for custom alinment subpixel interpolation


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

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

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

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

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

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

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

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

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

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

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

This reverts commit 96b2e4f603a3ae854d636f5d00adfd7781bc948d.


# Try to Find OpenGL and GLUT silently
# In addition sets two flags if the found versions are Apple frameworks
# OPENGL_IS_A_FRAMEWORK
# GLUT_IS_A_FRAMEWORK

find_package(OpenGL QUIET REQUIRED)

if(APPLE AND OPENGL_FOUND)
  if("${OPENGL_INCLUDE_DIR}" MATCHES "\\.framework")
    set(OPENGL_IS_A_FRAMEWORK TRUE)
  endif()
endif()

find_package(GLUT QUIET)

if(APPLE AND GLUT_FOUND)
  if("${GLUT_INCLUDE_DIR}" MATCHES "\\.framework")
    set(GLUT_IS_A_FRAMEWORK TRUE)
  endif()
endif()

# Try to Find OpenGL and GLUT silently
# In addition sets two flags if the found versions are Apple frameworks
# OPENGL_IS_A_FRAMEWORK
# GLUT_IS_A_FRAMEWORK

if(POLICY CMP0072)
  cmake_policy(SET CMP0072 NEW)
endif()

find_package(OpenGL QUIET REQUIRED)

if(APPLE AND OPENGL_FOUND)
  if("${OPENGL_INCLUDE_DIR}" MATCHES "\\.framework")
    set(OPENGL_IS_A_FRAMEWORK TRUE)
  endif()
endif()

find_package(GLUT QUIET)

if(APPLE AND GLUT_FOUND)
  if("${GLUT_INCLUDE_DIR}" MATCHES "\\.framework")
    set(GLUT_IS_A_FRAMEWORK TRUE)
  endif()
endif()

Set CMP0072 to NEW to prefer GLVND over legacy OpenGL modules


# Thrust manages its own copy of these rules. Update ThrustInstallRules.cmake
# if modifying this file.
if (CUB_IN_THRUST)
  return()
endif()

# Bring in CMAKE_INSTALL_LIBDIR
include(GNUInstallDirs)

# CUB is a header library; no need to build anything before installing:
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)

install(DIRECTORY "${CUB_SOURCE_DIR}/cub"
  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
  FILES_MATCHING
    PATTERN "*.cuh"
)

install(DIRECTORY "${CUB_SOURCE_DIR}/cub/cmake/"
  DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cub"
  PATTERN cub-header-search EXCLUDE
)
# Need to configure a file to store the infix specified in
# CMAKE_INSTALL_INCLUDEDIR since it can be defined by the user
set(install_location "${CMAKE_INSTALL_LIBDIR}/cmake/cub")
configure_file("${CUB_SOURCE_DIR}/cub/cmake/cub-header-search.cmake.in"
  "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake"
  @ONLY)
install(FILES "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake"
  DESTINATION "${install_location}")

# Thrust manages its own copy of these rules. Update ThrustInstallRules.cmake
# if modifying this file.
if (CUB_IN_THRUST)
  return()
endif()

# Bring in CMAKE_INSTALL_LIBDIR
include(GNUInstallDirs)

# CUB is a header library; no need to build anything before installing:
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)

install(DIRECTORY "${CUB_SOURCE_DIR}/cub"
  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
  FILES_MATCHING
    PATTERN "*.cuh"
)

install(DIRECTORY "${CUB_SOURCE_DIR}/cub/cmake/"
  DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cub"
  PATTERN *.cmake.in EXCLUDE
)
# Need to configure a file to store the infix specified in
# CMAKE_INSTALL_INCLUDEDIR since it can be defined by the user
set(install_location "${CMAKE_INSTALL_LIBDIR}/cmake/cub")
configure_file("${CUB_SOURCE_DIR}/cub/cmake/cub-header-search.cmake.in"
  "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake"
  @ONLY)
install(FILES "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake"
  DESTINATION "${install_location}")

Correct usage of install(DIRECTORY ... PATTERN) which matches at end of file name


itk_fetch_module(MGHIO
  "MGHIO ImageIO plugin for ITK"
  GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
  GIT_TAG 1beeaa5abb18188ded17bf6337b31c572d2594cf
  )

itk_fetch_module(MGHIO
  "MGHIO ImageIO plugin for ITK"
  GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
  GIT_TAG 3566fcdd053249a59ba958586d8c32e5042f285b
  )

COMP: Update git tag to incorporate MGHIO origin fix

Change-Id: Id60b0bcc4fca43c7e0e743e76989dde29b472c6f


# This file is the official location of the current liboro version number.
# Please do not add extra numerals in this file or change its formatting.

SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "5")
SET(CPACK_PACKAGE_VERSION_PATCH "9")

# This file is the official location of the current liboro version number.
# Please do not add extra numerals in this file or change its formatting.

SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "6")
SET(CPACK_PACKAGE_VERSION_PATCH "0")

Switch to version 0.6.0: socket-based liboro


ENABLE_TESTING()
INCLUDE( CTest )

MACRO( OPENSYNC_ADD_TEST _testName _testSource _targetLibraries )

  ADD_EXECUTABLE( ${_testName} ${_testSource} )
  TARGET_LINK_LIBRARIES( ${_testName} ${_targetLibraries} )
  ADD_TEST( ${_testName} ${CMAKE_CURRENT_BINARY_DIR}/${_testName} )

ENDMACRO( OPENSYNC_ADD_TEST )

ENABLE_TESTING()
INCLUDE( CTest )

MACRO( OPENSYNC_ADD_TEST _testName _testSource )

  ADD_EXECUTABLE( ${_testName} ${_testSource} )
  TARGET_LINK_LIBRARIES( ${_testName} ${ARGN} )
  ADD_TEST( ${_testName} ${CMAKE_CURRENT_BINARY_DIR}/${_testName} )

ENDMACRO( OPENSYNC_ADD_TEST )

Allow serveral target libraries as last argument.
Unfortunately only one testcase sources file is allowed for now...

git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@2714 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e


set( DOCUMENTATION "This module builds all the examples found at http://itk.org/ITKExamples" )

itk_module(ITKExamples
  DEPENDS
    ITKCommon
    EXCLUDE_FROM_DEFAULT
  DESCRIPTION
    "${DOCUMENTATION}"
  )

set( DOCUMENTATION "This module builds the examples found at http://itk.org/ITKExamples" )

itk_module(SphinxExamples
  DEPENDS
    ITKCommon
    EXCLUDE_FROM_DEFAULT
  DESCRIPTION
    "${DOCUMENTATION}"
  )

ENH: Rename module to follow Remote Module convention.

Change-Id: I4900b7c6cd2edf63016e530937fb964f47782c87


/* Define to 1 if you have a recent enough libassuan */
#cmakedefine HAVE_USABLE_ASSUAN 1

/* Define to 1 if your libassuan has the assuan_fd_t type  */
#cmakedefine HAVE_ASSUAN_FD_T 1

/* Define to 1 if your libassuan has the assuan_inquire_ext function */
#cmakedefine HAVE_ASSUAN_INQUIRE_EXT 1

/* Define to 1 if your assuan_inquire_ext puts the buffer arguments into the callback signature */
#cmakedefine HAVE_NEW_STYLE_ASSUAN_INQUIRE_EXT 1

/* Define to 1 if your libassuan has the assuan_sock_get_nonce function */
#cmakedefine HAVE_ASSUAN_SOCK_GET_NONCE 1

/* Define to 1 if you build libkleopatraclient */
#cmakedefine HAVE_KLEOPATRACLIENT_LIBRARY 1

#define KLEOPATRA_VERSION_STRING "@kleopatra_version@"

#if defined _WIN32 || defined _WIN64
#include <kde_file_win.h>
#endif

#if !defined(KPATH_SEPARATOR)
#if defined _WIN32 || defined _WIN64
#define KPATH_SEPARATOR ';'
#else
#define KPATH_SEPARATOR ':'
#endif
#endif

Add KPATH_SEPARATOR from kdelbs 4.1

Add KPATH_SEPARATOR from kdelbs 4.1

svn path=/trunk/KDE/kdepim/; revision=809795


find_package(Git)
if(GIT_EXECUTABLE)
  execute_process(
    COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --always --tags --dirty
    OUTPUT_VARIABLE PROJECT_VERSION
    ERROR_QUIET
  )

  # v{VERSION}-{N}-g{HASH} -> {VERSION}-{HASH}
  string(STRIP ${PROJECT_VERSION} PROJECT_VERSION)
  string(REGEX
    REPLACE "^v?([0-9]*.[0-9]*.[0-9]*)-[0-9]+-g([0-9a-f]*)" "\\1-\\2"
    PROJECT_VERSION
    ${PROJECT_VERSION}
  )
else()
  set(PROJECT_VERSION "0.0.0")
endif()

find_package(Git)
if(GIT_EXECUTABLE)
  execute_process(
    COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --always --tags --dirty
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    OUTPUT_VARIABLE PROJECT_VERSION
    ERROR_QUIET
  )

  # v{VERSION}-{N}-g{HASH} -> {VERSION}-{HASH}
  string(STRIP ${PROJECT_VERSION} PROJECT_VERSION)
  string(REGEX
    REPLACE "^v?([0-9]*.[0-9]*.[0-9]*)-[0-9]+-g([0-9a-f]*)" "\\1-\\2"
    PROJECT_VERSION
    ${PROJECT_VERSION}
  )
else()
  set(PROJECT_VERSION "0.0.0")
endif()

Fix version detection for out-of-source builds


# In order to statically link in the Boost, bz2, event and z libraries, they
# needs to be recompiled with -fPIC. Set $PIC_LIB_PATH to the location of
# these libraries in the environment, or dynamic linking will be used instead.

IF (DEFINED ENV{PIC_LIB_PATH})
    set(CMAKE_SKIP_RPATH TRUE)
    set(Boost_USE_STATIC_LIBS ON)
    set(Boost_USE_STATIC_RUNTIME ON)
    set(LIBBZ2 $ENV{PIC_LIB_PATH}/lib/libbz2.a)
    set(LIBZ $ENV{PIC_LIB_PATH}/lib/libz.a)
    set(LIBEVENT $ENV{PIC_LIB_PATH}/lib/libevent.a)
ELSE (DEFINED ENV{PIC_LIB_PATH})
    set(Boost_USE_STATIC_LIBS OFF)
    set(Boost_USE_STATIC_RUNTIME OFF)
    set(LIBBZ2 -lbz2)
    set(LIBZ -lz)
    set(LIBEVENT event)
ENDIF (DEFINED ENV{PIC_LIB_PATH})

# In order to statically link in the Boost, bz2, event and z libraries, they
# needs to be recompiled with -fPIC. Set $PIC_LIB_PATH to the location of
# these libraries in the environment, or dynamic linking will be used instead.

IF (DEFINED ENV{PIC_LIB_PATH})
    set(Boost_USE_STATIC_LIBS ON)
    set(Boost_USE_STATIC_RUNTIME ON)
    set(LIBBZ2 $ENV{PIC_LIB_PATH}/lib/libbz2.a)
    set(LIBZ $ENV{PIC_LIB_PATH}/lib/libz.a)
    set(LIBEVENT $ENV{PIC_LIB_PATH}/lib/libevent.a)
ELSE (DEFINED ENV{PIC_LIB_PATH})
    set(Boost_USE_STATIC_LIBS OFF)
    set(Boost_USE_STATIC_RUNTIME OFF)
    set(LIBBZ2 -lbz2)
    set(LIBZ -lz)
    set(LIBEVENT event)
ENDIF (DEFINED ENV{PIC_LIB_PATH})

Revert "IMP-594: Impala binaries are embedding build-time locations of libraries"

This reverts commit 748659845303b9a23ee36fc50f81aee0f1082cb9.


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

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

BUG: Address Shared Library issues with SCIFIO

Updates the SCIFIO remote module with the following:
caab429 ENH: Add library specific export specifier.
2744aaf BUG: Incorrect target link libraries specified as dependency
83de482 BUG: Fix bugs with CR removal in SCIFIOImageIO::WaitForNewLines

Change-Id: I346f3f7d91e7072f37b45c5674169be9fadb62aa


#
# file: littlefs1-sources.cmake
#
# author: Copyright (C) 2018-2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
# distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

add_library(littlefs1 STATIC
		${CMAKE_CURRENT_LIST_DIR}/littlefs1/lfs1_util.c
		${CMAKE_CURRENT_LIST_DIR}/littlefs1/lfs1.c)
target_compile_features(littlefs1 PUBLIC
		c_std_99)
target_compile_definitions(littlefs1 PUBLIC
		LFS1_NO_DEBUG
		LFS1_NO_ERROR
		LFS1_NO_MALLOC
		LFS1_NO_WARN)
target_include_directories(littlefs1 INTERFACE
		${CMAKE_CURRENT_LIST_DIR}/littlefs1)

#
# file: littlefs1-sources.cmake
#
# author: Copyright (C) 2018-2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
# distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

add_library(littlefs1 STATIC
		${CMAKE_CURRENT_LIST_DIR}/littlefs1/lfs1_util.c
		${CMAKE_CURRENT_LIST_DIR}/littlefs1/lfs1.c)
target_compile_features(littlefs1 PUBLIC
		c_std_99)
target_compile_definitions(littlefs1 PUBLIC
		LFS1_NO_DEBUG
		LFS1_NO_ERROR
		LFS1_NO_WARN)
target_include_directories(littlefs1 INTERFACE
		${CMAKE_CURRENT_LIST_DIR}/littlefs1)

Enable dynamic memory allocation directly in littlefs1


# -*- cmake -*-

include(Linking)

if (INSTALL_PROPRIETARY)
  set(LEAPMOTION ON CACHE BOOL "Building with Leap Motion Controller support.")
endif (INSTALL_PROPRIETARY)

if( LEAPMOTION )
  if (STANDALONE)
    # *TODO: Standalone support
  else (STANDALONE)
    include(Prebuilt)
    use_prebuilt_binary(leap-motion)
  if (DARWIN)
    set(LEAP_MOTION_LIBRARY libLeap.dylib)
  elseif (WINDOWS)
    set(LEAP_MOTION_LIBRARY
        debug Leapd.lib
        optimized Leap.lib)
   elseif (LINUX)
     set(LEAP_MOTION_LIBRARY libLeap.so)
   endif()
    set(LEAP_MOTION_INCLUDE_DIR ${LIBS_OPEN_DIR}/leap-motion)
  endif (STANDALONE)
endif( LEAPMOTION )

# -*- cmake -*-

include(Linking)

if (INSTALL_PROPRIETARY)
  set(LEAPMOTION ON CACHE BOOL "Building with Leap Motion Controller support.")
endif (INSTALL_PROPRIETARY)

if( LEAPMOTION )
  if (STANDALONE)
    # *TODO: Standalone support
  else (STANDALONE)
    include(Prebuilt)
    use_prebuilt_binary(leap-motion)
  if (DARWIN)
    set(LEAP_MOTION_LIBRARY libLeap.dylib)
  elseif (WINDOWS)
    if (ND_BUILD64BIT_ARCH)
        set(LEAP_MOTION_LIBRARY
            debug ${LIBS_PREBUILT_DIR}/lib/debug/x64/Leapd.lib
            optimized ${LIBS_PREBUILT_DIR}/lib/release/x64/Leap.lib)
    else (ND_BUILD64BIT_ARCH)
        set(LEAP_MOTION_LIBRARY
            debug ${LIBS_PREBUILT_DIR}/lib/debug/x86/Leapd.lib
            optimized ${LIBS_PREBUILT_DIR}/lib/release/x86/Leap.lib)
    endif (ND_BUILD64BIT_ARCH)
   elseif (LINUX)
     set(LEAP_MOTION_LIBRARY libLeap.so)
   endif()
    set(LEAP_MOTION_INCLUDE_DIR ${LIBS_OPEN_DIR}/leap-motion)
  endif (STANDALONE)
endif( LEAPMOTION )

Set correct path for Leap Motion static link library on Windows


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

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

include(polly_add_cache_flag)

polly_add_cache_flag(CMAKE_CXX_FLAGS "-m32")
polly_add_cache_flag(CMAKE_C_FLAGS "-m32")

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

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

include(polly_add_cache_flag)

polly_add_cache_flag(CMAKE_CXX_FLAGS "-m32")
polly_add_cache_flag(CMAKE_C_FLAGS "-m32 -march=native")

Add march flag to gcc x86 to enable SSE

Add march flag to gcc x86 to enable SSE


# -*- cmake -*-
#
# Find the OpenSSH scp ("secure copy") or Putty pscp command.
#
# Input variables:
#   SCP_FIND_REQUIRED - set this if configuration should fail without scp
#
# Output variables:
#
#   SCP_FOUND - set if scp was found
#   SCP_EXECUTABLE - path to scp or pscp executable
#   SCP_BATCH_FLAG - how to put scp/pscp into batch mode

SET(SCP_EXECUTABLE)
FIND_PROGRAM(SCP_EXECUTABLE NAMES scp scp.exe pscp pscp.exe)

IF (SCP_EXECUTABLE)
  SET(SCP_FOUND ON)
ELSE (SCP_EXECUTABLE)
  SET(SCP_FOUND OFF)
ENDIF (SCP_EXECUTABLE)

IF (SCP_FOUND)
  GET_FILENAME_COMPONENT(_scp_name ${SCP_EXECUTABLE} NAME_WE)
  IF (_scp_name STREQUAL scp)
    SET(SCP_BATCH_FLAG -B)
  ELSE (_scp_name STREQUAL scp)
    SET(SCP_BATCH_FLAG -batch)
  ENDIF (_scp_name STREQUAL scp)
ELSE (SCP_FOUND)
  IF (SCP_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could not find scp or pscp executable")
  ENDIF (SCP_FIND_REQUIRED)
ENDIF (SCP_FOUND)

MARK_AS_ADVANCED(SCP_EXECUTABLE SCP_FOUND SCP_BATCH_FLAG)

# -*- cmake -*-
#
# Find the OpenSSH scp ("secure copy") or Putty pscp command.
#
# Input variables:
#   SCP_FIND_REQUIRED - set this if configuration should fail without scp
#
# Output variables:
#
#   SCP_FOUND - set if scp was found
#   SCP_EXECUTABLE - path to scp or pscp executable
#   SCP_BATCH_FLAG - how to put scp/pscp into batch mode

SET(SCP_EXECUTABLE)
IF (WINDOWS)
  FIND_PROGRAM(SCP_EXECUTABLE NAMES pscp pscp.exe)
ELSE (WINDOWS)
  FIND_PROGRAM(SCP_EXECUTABLE NAMES scp scp.exe)
ENDIF (WINDOWS)

IF (SCP_EXECUTABLE)
  SET(SCP_FOUND ON)
ELSE (SCP_EXECUTABLE)
  SET(SCP_FOUND OFF)
ENDIF (SCP_EXECUTABLE)

IF (SCP_FOUND)
  GET_FILENAME_COMPONENT(_scp_name ${SCP_EXECUTABLE} NAME_WE)
  IF (_scp_name STREQUAL scp)
    SET(SCP_BATCH_FLAG -B)
  ELSE (_scp_name STREQUAL scp)
    SET(SCP_BATCH_FLAG -batch)
  ENDIF (_scp_name STREQUAL scp)
ELSE (SCP_FOUND)
  IF (SCP_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could not find scp or pscp executable")
  ENDIF (SCP_FIND_REQUIRED)
ENDIF (SCP_FOUND)

MARK_AS_ADVANCED(SCP_EXECUTABLE SCP_FOUND SCP_BATCH_FLAG)

Fix for windows + develop.py:  Use pscp on windows instead of scp.

This also requires a putty session to be created, same as we do for svn.


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

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

Fix ASIO setup for Jenkins (again)

Fix ASIO setup for Jenkins (again)


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

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

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

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

Fix default temporal/spatial filter values when subpixel is enabled


set(UPDATE_TYPE "true")

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

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "test.libssh.org")
set(CTEST_DROP_LOCATION "/submit.php?project=libssh")
set(CTEST_DROP_SITE_CDASH TRUE)

set(UPDATE_TYPE "true")

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

set(CTEST_DROP_METHOD "https")
set(CTEST_DROP_SITE "test.libssh.org")
set(CTEST_DROP_LOCATION "/submit.php?project=libssh")
set(CTEST_DROP_SITE_CDASH TRUE)

Drop reports via https only.

cmake: Drop reports via https only.

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>


MACRO (MYPACKAGECHECKCOMMONINCLUDEFILES)
  INCLUDE (CheckIncludeFile)
  CHECK_INCLUDE_FILE ("stdio.h"        HAVE_STDIO_H)
  CHECK_INCLUDE_FILE ("stddef.h"       HAVE_STDDEF_H)
  CHECK_INCLUDE_FILE ("stdlib.h"       HAVE_STDLIB_H)
  CHECK_INCLUDE_FILE ("stdarg.h"       HAVE_STDARG_H)
  CHECK_INCLUDE_FILE ("stdint.h"       HAVE_STDINT_H)
  CHECK_INCLUDE_FILE ("inttypes.h"     HAVE_INTTYPES_H)
  CHECK_INCLUDE_FILE ("sys/inttypes.h" HAVE_SYS_INTTYPES_H)
  CHECK_INCLUDE_FILE ("sys/time.h"     HAVE_SYS_TIME_H)
  CHECK_INCLUDE_FILE ("sys/types.h"    HAVE_SYS_TYPES_H)
  CHECK_INCLUDE_FILE ("sys/stat.h"     HAVE_SYS_STAT_H)
  CHECK_INCLUDE_FILE ("errno.h"        HAVE_ERRNO_H)
  CHECK_INCLUDE_FILE ("string.h"       HAVE_STRING_H)
  CHECK_INCLUDE_FILE ("unistd.h"       HAVE_UNISTD_H)
  CHECK_INCLUDE_FILE ("io.h"           HAVE_IO_H)
  CHECK_INCLUDE_FILE ("time.h"         HAVE_TIME_H)
  CHECK_INCLUDE_FILE ("fcntl.h"        HAVE_FCNTL_H)
ENDMACRO()

MACRO (MYPACKAGECHECKCOMMONINCLUDEFILES)
  INCLUDE (CheckIncludeFile)
  CHECK_INCLUDE_FILE ("stdio.h"        HAVE_STDIO_H)
  CHECK_INCLUDE_FILE ("stddef.h"       HAVE_STDDEF_H)
  CHECK_INCLUDE_FILE ("stdlib.h"       HAVE_STDLIB_H)
  CHECK_INCLUDE_FILE ("stdarg.h"       HAVE_STDARG_H)
  CHECK_INCLUDE_FILE ("stdint.h"       HAVE_STDINT_H)
  CHECK_INCLUDE_FILE ("inttypes.h"     HAVE_INTTYPES_H)
  CHECK_INCLUDE_FILE ("sys/inttypes.h" HAVE_SYS_INTTYPES_H)
  CHECK_INCLUDE_FILE ("sys/time.h"     HAVE_SYS_TIME_H)
  CHECK_INCLUDE_FILE ("sys/types.h"    HAVE_SYS_TYPES_H)
  CHECK_INCLUDE_FILE ("sys/stat.h"     HAVE_SYS_STAT_H)
  CHECK_INCLUDE_FILE ("errno.h"        HAVE_ERRNO_H)
  CHECK_INCLUDE_FILE ("string.h"       HAVE_STRING_H)
  CHECK_INCLUDE_FILE ("unistd.h"       HAVE_UNISTD_H)
  CHECK_INCLUDE_FILE ("io.h"           HAVE_IO_H)
  CHECK_INCLUDE_FILE ("time.h"         HAVE_TIME_H)
  CHECK_INCLUDE_FILE ("fcntl.h"        HAVE_FCNTL_H)
  CHECK_INCLUDE_FILE ("math.h"         HAVE_MATH_H)
  CHECK_INCLUDE_FILE ("float.h"        HAVE_FLOAT_H)
ENDMACRO()

Add checks of math.h and float.h

Add checks of math.h and float.h


# - This module looks for Microsoft Debugging Tools for Windows SDK
# It defines:
#   WINDBG_DIR               : full path to Windbg root dir
#

include (FindPackageMessage)

if (WIN32)
    find_path (WINDBG_DIR
        NAMES
            dbghelp.dll
            symsrv.dll
            symsrv.yes
        PATHS
            "$ENV{ProgramFiles}/Debugging Tools for Windows/sdk"
            "$ENV{ProgramFiles}/Debugging Tools for Windows (x86)/sdk"
            "$ENV{ProgramFiles}/Debugging Tools for Windows (x64)/sdk"
        NO_DEFAULT_PATH
        DOC "Microsoft Debugging Tools"
    )
    mark_as_advanced (WINDBG_DIR)
endif (WIN32)

if (WINDBG_DIR)
    set (WINDBG_FOUND 1)
    find_package_message (WINDBG "Found WinDbg: ${WINDBG_DIR}" "[${WINDBG_DIR}]")
endif ()
mark_as_advanced (WINDBG_FOUND)

# - This module looks for Microsoft Debugging Tools for Windows SDK
# It defines:
#   WINDBG_DIR               : full path to Windbg root dir
#

include (FindPackageHandleStandardArgs)

if (WIN32)
    find_path (WINDBG_DIR
        NAMES
            dbghelp.dll
            symsrv.dll
            symsrv.yes
        PATHS
            "$ENV{ProgramFiles}/Debugging Tools for Windows/sdk"
            "$ENV{ProgramFiles}/Debugging Tools for Windows (x86)/sdk"
            "$ENV{ProgramFiles}/Debugging Tools for Windows (x64)/sdk"
        NO_DEFAULT_PATH
        DOC "Microsoft Debugging Tools"
    )
    mark_as_advanced (WINDBG_DIR)
endif (WIN32)

find_package_handle_standard_args (WinDbg DEFAULT_MSG WINDBG_DIR)

cmake: Use FindPackageHandleStandardArgs module for WinDbg.


# - Set project information variables.

include(Tools)

if(NOT PROJECT_INFO_CMAKE)
  set(PROJECT_INFO_CMAKE TRUE)

  check_cmake_vars_exists(
    PROJECT_VERSION_MAJOR
    PROJECT_VERSION_MINOR
    PROJECT_LONGNAME
    )

  set(PROJECT_COPYRIGHT_HOLDER "Gostai S.A.S")
  set(PROJECT_COPYRIGHT_YEARS "2006-2008")
  set(PROJECT_COPYRIGHT_STRING
    "Copyright (C) ${PROJECT_COPYRIGHT_YEARS} ${PROJECT_COPYRIGHT_HOLDER}")

  include(Revision)
  revision(PROJECT_DATE PROJECT_ID PROJECT_REVISION)
  set(PROJECT_VERSION_PATCH ${PROJECT_REVISION})

  message(STATUS "Project repository date: ${PROJECT_DATE}")
  message(STATUS "Project repository ID: ${PROJECT_ID}")
  message(STATUS "Project repository revision: ${PROJECT_REVISION}")

  set(PROJECT_VERSION
    "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
  set(PROJECT_VERSION_REV "version ${PROJECT_VERSION} rev. ${PROJECT_REVISION}")

  set(PROJECT_STRING "${PROJECT_LONGNAME} ${PROJECT_VERSION}")

  set(PROJECT_TARNAME "${PROJECT_NAME}-${PROJECT_VERSION}-${PROJECT_REVISION}")

endif(NOT PROJECT_INFO_CMAKE)

# - Set project information variables.

include(Tools)

if(NOT PROJECT_INFO_CMAKE)
  set(PROJECT_INFO_CMAKE TRUE)

  check_cmake_vars_exists(
    PROJECT_VERSION_MAJOR
    PROJECT_VERSION_MINOR
    PROJECT_LONGNAME
    )

  set(PROJECT_COPYRIGHT_HOLDER "Gostai S.A.S")
  set(PROJECT_COPYRIGHT_YEARS "2006-2008")
  set(PROJECT_COPYRIGHT_STRING
    "(C) ${PROJECT_COPYRIGHT_YEARS} ${PROJECT_COPYRIGHT_HOLDER}")

  include(Revision)
  revision(PROJECT_DATE PROJECT_ID PROJECT_REVISION)
  set(PROJECT_VERSION_PATCH ${PROJECT_REVISION})

  message(STATUS "Project repository date: ${PROJECT_DATE}")
  message(STATUS "Project repository ID: ${PROJECT_ID}")
  message(STATUS "Project repository revision: ${PROJECT_REVISION}")

  set(PROJECT_VERSION
    "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
  set(PROJECT_VERSION_REV "version ${PROJECT_VERSION} rev. ${PROJECT_REVISION}")

  set(PROJECT_STRING "${PROJECT_LONGNAME} ${PROJECT_VERSION}")

  set(PROJECT_TARNAME "${PROJECT_NAME}-${PROJECT_VERSION}-${PROJECT_REVISION}")

endif(NOT PROJECT_INFO_CMAKE)

Remove "Copyright" from the copyright string.

	* build-aux/cmake/modules/ProjectInfo.cmake: Here.


if (DOWNLOAD_EXTERNALS)

  # Configure boost
  # ---------------
  # Note: a script is used to checkout a quasi minimal version
  set(DOWNLOAD_DIR ${EXTERNALS_DIR}/boost)

  ExternalProject_Add(boost
    DOWNLOAD_COMMAND svn co --depth files http://svn.boost.org/svn/boost/tags/release/Boost_1_50_0/boost
    DOWNLOAD_DIR ${DOWNLOAD_DIR}
    TMP_DIR ${DOWNLOAD_DIR}/tmp
    STAMP_DIR ${DOWNLOAD_DIR}/stamp
    UPDATE_COMMAND svn update
      ${DOWNLOAD_DIR}/boost/config
      ${DOWNLOAD_DIR}/boost/detail
      ${DOWNLOAD_DIR}/boost/exception
      ${DOWNLOAD_DIR}/boost/smart_ptr
      ${DOWNLOAD_DIR}/boost/algorithm
      ${DOWNLOAD_DIR}/boost/iterator
      ${DOWNLOAD_DIR}/boost/mpl
      ${DOWNLOAD_DIR}/boost/range
      ${DOWNLOAD_DIR}/boost/type_traits
      ${DOWNLOAD_DIR}/boost/preprocessor
      ${DOWNLOAD_DIR}/boost/utility
      ${DOWNLOAD_DIR}/boost/concept
      ${DOWNLOAD_DIR}/boost/function
      ${DOWNLOAD_DIR}/boost/bind
      ${DOWNLOAD_DIR}
    CONFIGURE_COMMAND "" # skip configure
    BUILD_COMMAND "" # skip build
    INSTALL_COMMAND "" # skip install
  )

endif()

set(BOOST_INCLUDE_DIRS ${EXTERNALS_DIR}/boost)

if (DOWNLOAD_EXTERNALS)

  # Configure boost
  # ---------------
  # Note: a script is used to checkout a quasi minimal version
  set(DOWNLOAD_DIR ${EXTERNALS_DIR}/boost)

  ExternalProject_Add(boost
    DOWNLOAD_COMMAND svn co --depth files http://svn.boost.org/svn/boost/tags/release/Boost_1_50_0/boost
    DOWNLOAD_DIR ${DOWNLOAD_DIR}
    TMP_DIR ${DOWNLOAD_DIR}/tmp
    STAMP_DIR ${DOWNLOAD_DIR}/stamp
    UPDATE_COMMAND svn update
      ${DOWNLOAD_DIR}/boost/config
      ${DOWNLOAD_DIR}/boost/detail
      ${DOWNLOAD_DIR}/boost/exception
      ${DOWNLOAD_DIR}/boost/smart_ptr
      ${DOWNLOAD_DIR}/boost/algorithm
      ${DOWNLOAD_DIR}/boost/iterator
      ${DOWNLOAD_DIR}/boost/mpl
      ${DOWNLOAD_DIR}/boost/range
      ${DOWNLOAD_DIR}/boost/type_traits
      ${DOWNLOAD_DIR}/boost/preprocessor
      ${DOWNLOAD_DIR}/boost/utility
      ${DOWNLOAD_DIR}/boost/concept
      ${DOWNLOAD_DIR}/boost/function
      ${DOWNLOAD_DIR}/boost/bind
      ${DOWNLOAD_DIR}/boost/format
      ${DOWNLOAD_DIR}/boost/optional
      ${DOWNLOAD_DIR}
    CONFIGURE_COMMAND "" # skip configure
    BUILD_COMMAND "" # skip build
    INSTALL_COMMAND "" # skip install
  )

endif()

set(BOOST_INCLUDE_DIRS ${EXTERNALS_DIR}/boost)

Add more boost subdirectories to boost download.


message(STATUS "Make Boost libraries use RPATH")

file(GLOB boost_dylibs ./libboost*.dylib)

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

message(STATUS "Make Boost libraries use RPATH")

file(GLOB boost_dylibs ./libboost*.dylib)

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

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

Fix dependencies between Boost dylibs

Fix dependencies between Boost dylibs


# support creating some basic binpkgs via `make package`

set(CPACK_SET_DESTDIR ON)
set(CPACK_GENERATOR TGZ)

include(CPack)

# support creating some basic binpkgs via `make package`

set(CPACK_SET_DESTDIR ON)
set(CPACK_GENERATOR TGZ)

set(CPACK_PACKAGE_VERSION_MAJOR ${LIBIIO_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${LIBIIO_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH g${LIBIIO_VERSION_GIT})
set(CPACK_BUNDLE_NAME libiio)
set(CPACK_PACKAGE_VERSION ${LIBIIO_VERSION})

include(CPack)

cmake: Set the OSX versions for the tarballs correctly

Signed-off-by: Robin Getz <c66e5a86ef9317cf35cecb2ed063996b2100ed4b@analog.com>


if( LIBSSH_INCLUDE_DIR AND LIBSSH_LIBRARY )
	set( LIBSSH_FIND_QUIETLY true )
endif( LIBSSH_INCLUDE_DIR AND LIBSSH_LIBRARY )

find_path( LIBSSH_INCLUDE_DIR libssh/libssh.h )

find_library( LIBSSH_LIBRARY
		NAMES ssh
		PATHS /usr/local/lib /usr/pkg/lib /opt/lib /usr/lib /lib
		NO_DEFAULT_PATH
)

include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( LibSSH DEFAULT_MSG LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY )

mark_as_advanced( LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY )

if( LIBSSH_INCLUDE_DIR AND LIBSSH_LIBRARY )
	set( LIBSSH_FIND_QUIETLY true )
endif( LIBSSH_INCLUDE_DIR AND LIBSSH_LIBRARY )

find_path( LIBSSH_INCLUDE_DIR libssh/libssh.h )

find_library( LIBSSH_LIBRARY
		NAMES ssh
		PATHS /usr/local/lib /usr/pkg/lib /opt/lib /usr/lib64 /usr/lib /lib
		NO_DEFAULT_PATH
)

include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( LibSSH DEFAULT_MSG LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY )

mark_as_advanced( LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY )

Add /usr/lib64 for search path

Add /usr/lib64 for search path


#
# Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
#  http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file 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.
#

# for make uninstall
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
    message(FATAL_ERROR "Cannot find install manifest: ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
endif()

file(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" files)
string(REGEX REPLACE "[ \r\n\t]" ";" files "${files}")

foreach(file ${files})
    message(STATUS "Uninstalling ${file}")
    if(EXISTS "${file}")
        file(REMOVE ${file})
        if (EXISTS "${file}")
            message(FATAL_ERROR "Problem when removing ${file}, please check your permissions")
        endif()
    else()
        message(STATUS "File ${file} does not exist.")
    endif()
endforeach()

#
# Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
#  http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file 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.
#

# for make uninstall
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
    message(FATAL_ERROR "Cannot find install manifest: ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
endif()

file(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" files)
string(REGEX REPLACE "[\r\n]" ";" files "${files}")

foreach(file ${files})
    message(STATUS "Uninstalling ${file}")
    if(EXISTS "${file}")
        file(REMOVE ${file})
        if (EXISTS "${file}")
            message(FATAL_ERROR "Problem when removing ${file}, please check your permissions")
        endif()
    else()
        message(STATUS "File ${file} does not exist.")
    endif()
endforeach()

Fix uninstall with white char inside path


# Find the vecLib libraries as part of Accelerate.framework or as standalon framework
#
# The following are set after configuration is done:
#  VECLIB_FOUND
#  vecLib_INCLUDE_DIR
#  vecLib_LINKER_LIBS

if(NOT APPLE)
  return()
endif()

set(__veclib_include_suffix "Frameworks/vecLib.framework/Versions/Current/Headers")

find_path(vecLib_INCLUDE_DIR vecLib.h
          DOC "vecLib include directory"
          PATHS /System/Library/Frameworks/Accelerate.framework/Versions/Current/${__veclib_include_suffix}
                /System/Library/${__veclib_include_suffix}
                /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
          NO_DEFAULT_PATH)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(vecLib DEFAULT_MSG vecLib_INCLUDE_DIR)

if(VECLIB_FOUND)
  if(vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
    set(vecLib_LINKER_LIBS -lcblas "-framework vecLib")
    message(STATUS "Found standalone vecLib.framework")
  else()
    set(vecLib_LINKER_LIBS -lcblas "-framework Accelerate")
    message(STATUS "Found vecLib as part of Accelerate.framework")
  endif()

  mark_as_advanced(vecLib_INCLUDE_DIR)
endif()

# Find the vecLib libraries as part of Accelerate.framework or as standalon framework
#
# The following are set after configuration is done:
#  VECLIB_FOUND
#  vecLib_INCLUDE_DIR
#  vecLib_LINKER_LIBS

if(NOT APPLE)
  return()
endif()

set(__veclib_include_suffix "Frameworks/vecLib.framework/Versions/Current/Headers")

find_path(vecLib_INCLUDE_DIR vecLib.h
          DOC "vecLib include directory"
          PATHS /System/Library/Frameworks/Accelerate.framework/Versions/Current/${__veclib_include_suffix}
                /System/Library/${__veclib_include_suffix}
                /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
          NO_DEFAULT_PATH)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(vecLib DEFAULT_MSG vecLib_INCLUDE_DIR)

if(VECLIB_FOUND)
  if(vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
    set(vecLib_LINKER_LIBS -lcblas "-framework vecLib")
    message(STATUS "Found standalone vecLib.framework")
  else()
    set(vecLib_LINKER_LIBS -lcblas "-framework Accelerate")
    message(STATUS "Found vecLib as part of Accelerate.framework")
  endif()

  mark_as_advanced(vecLib_INCLUDE_DIR)
endif()

Remove sdk version from veclib searching path.


#
# See documentation in Trilinos preCopyrightTrilinos/ExtraExternalRepositories.cmake
#

SET( DataTransferKit_PACKAGES_AND_DIRS_AND_CLASSIFICATIONS
  DataTransferKit         .     SS
  )

TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(DataTransferKit Windows)

#
# See documentation in Trilinos preCopyrightTrilinos/ExtraExternalRepositories.cmake
#

SET( DataTransferKit_PACKAGES_AND_DIRS_AND_CLASSIFICATIONS
  DataTransferKit         .     ST
  )

TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(DataTransferKit Windows)

Update repository test classification SS (deprecated) -> ST


# Try to find the KAccounts UI library
#
# Copyright (c) 2011, Dario Freddi <drf@kde.org>
# Copyright (c) 2014, Martin Klapetek <mklapetek@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

SET (KACCOUNTS_FIND_REQUIRED ${KAccounts_FIND_REQUIRED})
if (KACCOUNTS_INCLUDE_DIRS AND KACCOUNTS_LIBRARIES)
  # Already in cache, be silent
  set(KACCOUNTS_FIND_QUIETLY TRUE)
endif (KACCOUNTS_INCLUDE_DIRS AND KACCOUNTS_LIBRARIES)

find_path(KACCOUNTS_INCLUDE_DIR
  NAMES KAccounts/kaccountsuiplugin.h
  PATHS ${CMAKE_INSTALL_FULL_INCLUDEDIR}
)

find_library(KACCOUNTS_LIBRARIES NAMES kaccounts)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(KAccounts DEFAULT_MSG
                                  KACCOUNTS_LIBRARIES
                                  KACCOUNTS_INCLUDE_DIR)

mark_as_advanced(KACCOUNTS_INCLUDE_DIRS KACCOUNTS_LIBRARIES)

# Try to find the KAccounts UI library
#
# Copyright (c) 2011, Dario Freddi <drf@kde.org>
# Copyright (c) 2014, Martin Klapetek <mklapetek@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

SET (KACCOUNTS_FIND_REQUIRED ${KAccounts_FIND_REQUIRED})
if (KACCOUNTS_INCLUDE_DIR AND KACCOUNTS_LIBRARY)
  # Already in cache, be silent
  set(KACCOUNTS_FIND_QUIETLY TRUE)
endif (KACCOUNTS_INCLUDE_DIR AND KACCOUNTS_LIBRARY)

find_path(KACCOUNTS_INCLUDE_DIR
  NAMES KAccounts/kaccountsuiplugin.h
  PATHS ${CMAKE_INSTALL_FULL_INCLUDEDIR}
)

find_library(KACCOUNTS_LIBRARY NAMES kaccounts)

set(KACCOUNTS_INCLUDE_DIRS ${KACCOUNTS_INCLUDE_DIR})
set(KACCOUNTS_LIBRARIES ${KACCOUNTS_LIBRARY})

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(KAccounts DEFAULT_MSG
                                  KACCOUNTS_LIBRARY
                                  KACCOUNTS_INCLUDE_DIR)

mark_as_advanced(KACCOUNTS_INCLUDE_DIR KACCOUNTS_LIBRARY)

Fix the KAccounts cmake module

Fix the KAccounts cmake module

Matches AccountsQt module now


#.rst:
#
# Sets binary and library output directories to ${PROJECT_BINARY_DIR}/bin
# and ${PROJECT_BINARY_DIR}/lib, respectively.
#
# Variables modified::
#
#   CMAKE_RUNTIME_OUTPUT_DIRECTORY
#   CMAKE_LIBRARY_OUTPUT_DIRECTORY

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)

#.rst:
#
# Sets binary and library output directories to ${PROJECT_BINARY_DIR}/bin
# and ${PROJECT_BINARY_DIR}/lib, respectively.
#
# Variables modified::
#
#   CMAKE_ARCHIVE_OUTPUT_DIRECTORY
#   CMAKE_LIBRARY_OUTPUT_DIRECTORY
#   CMAKE_RUNTIME_OUTPUT_DIRECTORY

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)

Send also static libraries to ${PROJECT_BINARY_DIR}/lib


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

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

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

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

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

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

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

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

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

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

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

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

Remove Mahalanobis example if HAVE_LAPACK is not available


# use pybind11's tools to find python and create python modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/hoomd/extern/pybind/tools)

# for installed hoomd with external plugins
if (HOOMD_INCLUDE_DIR)
    list(APPEND CMAKE_MODULE_PATH ${HOOMD_INCLUDE_DIR}/hoomd/extern/pybind/tools)
endif()

# find_package(pybind11 NO_MODULE)
include(pybind11Tools)

# set python installation location
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
    execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import site; print(site.getsitepackages()[0], end='')"
                    OUTPUT_VARIABLE _python_site_dir)
    set(CMAKE_INSTALL_PREFIX ${_python_site_dir} CACHE PATH "HOOMD installation path" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

set(PYTHON_SITE_INSTALL_DIR "hoomd")

# use pybind11's tools to find python and create python modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/hoomd/extern/pybind/tools)

# for installed hoomd with external plugins
if (HOOMD_INCLUDE_DIR)
    list(APPEND CMAKE_MODULE_PATH ${HOOMD_INCLUDE_DIR}/hoomd/extern/pybind/tools)
endif()

# find_package(pybind11 NO_MODULE)
include(pybind11Tools)

# when no CMAKE_INSTALL_PREFIX is set, default to python's install prefix
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND PYTHON_SITE_PACKAGES)
    string(LENGTH "${PYTHON_PREFIX}" _python_prefix_len)
    string(SUBSTRING "${PYTHON_SITE_PACKAGES}" 0 ${_python_prefix_len} _python_site_package_prefix)
    math(EXPR _shart_char "${_python_prefix_len}+1")
    string(SUBSTRING "${PYTHON_SITE_PACKAGES}" ${_shart_char} -1 _python_site_package_rel)
    string(COMPARE EQUAL "${_python_site_package_prefix}" "${PYTHON_PREFIX}" _prefix_equal)
    if (NOT _prefix_equal)
        message(STATUS "Python site packages (${PYTHON_SITE_PACKAGES}) does not start with python prefix (${PYTHON_PREFIX})")
        message(STATUS "HOOMD may not install to the correct location")
    endif()

    set(CMAKE_INSTALL_PREFIX "${PYTHON_PREFIX}" CACHE PATH "HOOMD installation path" FORCE)
endif()

# when the user specifies CMAKE_INSTALL_PREFIX, install to "hoomd" under that prefix
if (_python_site_package_rel)
    set(PYTHON_SITE_INSTALL_DIR "${_python_site_package_rel}/hoomd")
else()
    set(PYTHON_SITE_INSTALL_DIR "hoomd")
endif()

message(STATUS "PYTHON_SITE_INSTALL_DIR: ${PYTHON_SITE_INSTALL_DIR}")
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")

Install to python prefix by default

Install to python prefix by default

Retain old installation behavior when CMAKE_INSTALL_PREFIX is set on the command line


set(LABEL_EXPR "$ENV{label_exp}")
if ("${LABEL_EXPR}" MATCHES "gcc" OR "${LABEL_EXPR}" MATCHES "gcovr")
  message(STATUS "Set CXX to g++ based on label_expr content")
  set(CMAKE_C_COMPILER "gcc" CACHE PATH "C compiler option")
  set(CMAKE_CXX_COMPILER "g++" CACHE PATH "C++ compiler option")
  # OpenCL header on OSX do not work with GCC
  if(APPLE)
    set(CAF_NO_OPENCL yes CACHE BOOL "Configure OpenCL module")
  endif(APPLE)
elseif ("${LABEL_EXPR}" MATCHES "clang")
  message(STATUS "Set CXX to clang++ based on label_expr content")
  set(CMAKE_C_COMPILER "clang" CACHE STRING "C compiler option")
  set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "C++ compiler option")
endif()
# disable SSL when doing leak checking due to a known issue with the module
if (${LABEL_EXPR} MATCHES "LeakSanitizer")
  set(CAF_NO_OPENSSL yes CACHE BOOL "Configure OpenSSL module")
endif()

Disable Jenkins leak checking for OpenSSL module


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

# Load toolchain file
if(NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED)
    set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "")
    include(${MBED_PATH}/tools/cmake/toolchain.cmake)
endif()

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

enable_language(C CXX ASM)

# set executable suffix (has to be done after enabling languages)
# Note: This is nice to have, but is also required because STM32Cube will only work on files with a .elf extension
set(CMAKE_EXECUTABLE_SUFFIX .elf)

Set executable suffix in CMake

Set executable suffix in CMake


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

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

# define the dependencies of the include module and the tests
itk_module(ITKOBBLabelMap
  DEPENDS
    ITKCommon
    ITKLabelMap
  TEST_DEPENDS
    ITKTestKernel
    ITKMetaIO
  DESCRIPTION
    "${DOCUMENTATION}"
)

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

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

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

# define the dependencies of the include module and the tests
itk_module(ITKOBBLabelMap
  DEPENDS
    ITKCommon
    ITKLabelMap
  TEST_DEPENDS
    ITKTestKernel
    ITKMetaIO
  DESCRIPTION
    "${DOCUMENTATION}"
  ${_EXCLUDE}
)

Exclude module from being turned on by default


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

set(ENV{LANG} "C")
set(ENV{LC_ALL} "C")
set(ENV{BUILD_DIR} ${CTEST_MODULE_DIR})
set(ENV{LUA_PATH} ${PROJECT_SOURCE_DIR}/src/lua/?.lua)
set(ENV{HAKA_PATH} ${HAKA_PATH})
set(ENV{LD_LIBRARY_PATH} ${HAKA_PATH}/lib:${HAKA_PATH}/lib/haka/modules/protocol:${HAKA_PATH}/lib/haka/modules/packet)
set(ENV{TZ} Europe/Paris)
set(ENV{CONF} ${CONF})

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

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

execute_process(COMMAND ${EXE} ${BENCH} RESULT_VARIABLE HAD_ERROR)

if(HAD_ERROR)
	message(FATAL_ERROR "Benchmark script failed")
endif(HAD_ERROR)

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

set(ENV{LANG} "C")
set(ENV{LC_ALL} "C")
set(ENV{BUILD_DIR} ${CTEST_MODULE_DIR})
set(ENV{LUA_PATH} ${PROJECT_SOURCE_DIR}/src/lua/?.lua)
set(ENV{HAKA_PATH} ${HAKA_PATH})
set(ENV{PATH} $ENV{PATH}:${HAKA_PATH}/sbin:${HAKA_PATH}/bin)
set(ENV{LD_LIBRARY_PATH} ${HAKA_PATH}/lib:${HAKA_PATH}/lib/haka/modules/protocol:${HAKA_PATH}/lib/haka/modules/packet)
set(ENV{TZ} Europe/Paris)
set(ENV{CONF} ${CONF})

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

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

execute_process(COMMAND ${EXE} ${BENCH} RESULT_VARIABLE HAD_ERROR)

if(HAD_ERROR)
	message(FATAL_ERROR "Benchmark script failed")
endif(HAD_ERROR)

Fix PATH for bench target

Fix PATH for bench target


MACRO(GET_PYTHON_ENV)
	LIST(APPEND PYTHON_ENV_VARS GDB="gdb -x ${CMAKE_SOURCE_DIR}/src/.gdb --args")
	LIST(APPEND PYTHON_ENV_VARS PYTHON=${PYTHON_EXECUTABLE})
	LIST(APPEND PYTHON_ENV_VARS PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${PYTHON_PACKAGES_PATH}:$ENV{PYTHONPATH})
	if(WIN32)
	  LIST(APPEND PYTHON_ENV_VARS PATH=${CMAKE_INSTALL_PREFIX}/lib;$ENV{PATH})
	elseif(APPLE)
	  LIST(APPEND PYTHON_ENV_VARS DYLD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:$ENV{DYLD_LIBRARY_PATH})
	else()
	  LIST(APPEND PYTHON_ENV_VARS LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:$ENV{LD_LIBRARY_PATH})
	endif()
ENDMACRO()

MACRO(GET_PYTHON_ENV)
	LIST(APPEND PYTHON_ENV_VARS GDB="gdb -x ${CMAKE_SOURCE_DIR}/src/.gdb --args")
	LIST(APPEND PYTHON_ENV_VARS PYTHON=${PYTHON_EXECUTABLE})
	LIST(APPEND PYTHON_ENV_VARS PYTHONPATH=${CMAKE_BINARY_DIR}/src/interfaces/python:${CMAKE_INSTALL_PREFIX}/${PYTHON_PACKAGES_PATH}:$ENV{PYTHONPATH})
	if(WIN32)
		LIST(APPEND PYTHON_ENV_VARS PATH=${CMAKE_BINARY_DIR}/src/shogun;${CMAKE_INSTALL_PREFIX}/lib;$ENV{PATH})
	elseif(APPLE)
		LIST(APPEND PYTHON_ENV_VARS DYLD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/shogun:${CMAKE_INSTALL_PREFIX}/lib:$ENV{DYLD_LIBRARY_PATH})
	else()
		LIST(APPEND PYTHON_ENV_VARS LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/shogun:${CMAKE_INSTALL_PREFIX}/lib:$ENV{LD_LIBRARY_PATH})
	endif()
ENDMACRO()

Test python examples against build

Test python examples against build


cmake_minimum_required(VERSION 2.8)

macro(setup_project NAME)
    set(PROJECT_NAME "${NAME}")
    set(PROJECT_INSTALL_NAME "${NAME}")
    if(NOT "${ARGV1}" STREQUAL "")
        set(PROJECT_INSTALL_NAME "${ARGV1}")
    endif()
    project("${NAME}" CXX)

    # Utility functions and macros
    include(${PROJECT_CMAKE_DIR}/CMakeUtil.cmake)
    # Identify OS and setup
    include(${PROJECT_CMAKE_DIR}/SetupOs.cmake)
    # Setup directories and paths
    include(${PROJECT_CMAKE_DIR}/SetupDirs.cmake)

    # Boost
    MESSAGE(STATUS "Looking for Boost")
    set(Boost_USE_MULTITHREADED ON)
    set(Boost_ADDITIONAL_VERSIONS "1.48.0" "1.48")
    set(Boost_NO_SYSTEM_PATHS ON) # prevent mixing different Boost installations
    find_package(Boost 1.48)
    include_directories(${Boost_INCLUDE_DIR})
    MESSAGE(STATUS "Boost found at ${Boost_INCLUDE_DIR}")

    include(${PROJECT_CMAKE_DIR}/CompileSettings.cmake)
    include(${PROJECT_CMAKE_DIR}/Installation.cmake)
    include(${PROJECT_CMAKE_DIR}/Testing.cmake)
    include(${PROJECT_CMAKE_DIR}/Documentation.cmake)

    export_project()

    # This variable is needed in Installation.cmake for setting
    # PROJECT_INCLUDE_DIRS
    set(PROJECT_INCLUDE_DIRECTORIES
        ${PROJECT_SOURCE_DIR}/src
        ${PROJECT_BINARY_DIR}/src
    )

    include_directories(${PROJECT_INCLUDE_DIRECTORIES})

    link_directories(${PROJECT_LIB_DIR})
endmacro()

cmake_minimum_required(VERSION 2.8)

macro(setup_project NAME)
    set(PROJECT_NAME "${NAME}")
    set(PROJECT_INSTALL_NAME "${NAME}")
    if(NOT "${ARGV1}" STREQUAL "")
        set(PROJECT_INSTALL_NAME "${ARGV1}")
    endif()
    project("${NAME}" CXX)

    # Utility functions and macros
    include(${PROJECT_CMAKE_DIR}/CMakeUtil.cmake)
    # Identify OS and setup
    include(${PROJECT_CMAKE_DIR}/SetupOs.cmake)
    # Setup directories and paths
    include(${PROJECT_CMAKE_DIR}/SetupDirs.cmake)

    # Boost
    MESSAGE(STATUS "Looking for Boost")
    set(Boost_USE_MULTITHREADED ON)
    set(Boost_ADDITIONAL_VERSIONS "1.48.0" "1.48")
    set(Boost_NO_SYSTEM_PATHS ON) # prevent mixing different Boost installations
    find_package(Boost 1.46)
    include_directories(${Boost_INCLUDE_DIR})
    MESSAGE(STATUS "Boost found at ${Boost_INCLUDE_DIR}")

    include(${PROJECT_CMAKE_DIR}/CompileSettings.cmake)
    include(${PROJECT_CMAKE_DIR}/Installation.cmake)
    include(${PROJECT_CMAKE_DIR}/Testing.cmake)
    include(${PROJECT_CMAKE_DIR}/Documentation.cmake)

    export_project()

    # This variable is needed in Installation.cmake for setting
    # PROJECT_INCLUDE_DIRS
    set(PROJECT_INCLUDE_DIRECTORIES
        ${PROJECT_SOURCE_DIR}/src
        ${PROJECT_BINARY_DIR}/src
    )

    include_directories(${PROJECT_INCLUDE_DIRECTORIES})

    link_directories(${PROJECT_LIB_DIR})
endmacro()

Allow boost 1.46 which is available on travis


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

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 145e6342bd340919574003e4e324b0b9ebf49d26
  )

BUG: Fix itkFDFImageIOTest link error on windows

Update IOFDF remote module. Use correct main signature on test for
windows.

Change-Id: I468dbd131f9a79f3dd466172ec1ff4087a2a3ffb


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

Enable Jenkins to use the asio tag

Enable Jenkins to use the asio tag


# Try to find Sampgdk3
#
# Defined variables:
# - Sampgdk3_FOUND
# - Sampgdk3_INCLUDE_DIRS
# - Sampgdk3_LIBRARIES

find_path(Sampgdk3_INCLUDE_DIR NAMES sampgdk/a_samp.h)
find_library(Sampgdk3_LIBRARY NAMES sampgdk3 libsampgdk3)

set(Sampgdk3_LIBRARIES ${Sampgdk3_LIBRARY})
set(Sampgdk3_INCLUDE_DIRS ${Sampgdk3_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Sampgdk3 DEFAULT_MSG Sampgdk3_LIBRARY Sampgdk3_INCLUDE_DIR)

mark_as_advanced(Sampgdk3_LIBRARY Sampgdk3_INCLUDE_DIR)

# Try to find Sampgdk3
#
# Defined variables:
# - Sampgdk3_FOUND
# - Sampgdk3_INCLUDE_DIRS
# - Sampgdk3_LIBRARIES

find_path(Sampgdk3_INCLUDE_DIR NAMES sampgdk/a_samp.h)
find_library(Sampgdk3_LIBRARY NAMES sampgdk3 libsampgdk3)

set(Sampgdk3_LIBRARIES ${Sampgdk3_LIBRARY})
set(Sampgdk3_INCLUDE_DIRS ${Sampgdk3_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Sampgdk3 DEFAULT_MSG Sampgdk3_LIBRARY Sampgdk3_INCLUDE_DIR)

mark_as_advanced(Sampgdk3_LIBRARIES Sampgdk3_INCLUDE_DIRS)

Fix wrong variables marked as advanced

Fix wrong variables marked as advanced

Should mark LIBRARIES and DIRS rather than LIBRARY and DIR


# Set necessary compile and link flags
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wformat -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -Wformat=2 -Wextra -Wnon-virtual-dtor -fPIC -O0")
    if(WITH_COVERAGE)
        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
    endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
    # TODO figure clang stuff to enable test-coverage
    # Instrument Program flow should be set to Yes
    # http://stackoverflow.com/questions/7949781/undefined-symbols-for-architecture-i386-upgrading-project-to-ios-5
    set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -Wall -Wextra -Wnon-virtual-dtor -fPIC -O0")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
    # no msvc flags for now
endif()

# Set necessary compile and link flags
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wformat -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -Wformat=2 -Wextra -Wnon-virtual-dtor -fPIC -O0")
    if(WITH_COVERAGE)
        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
    endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    # TODO figure clang stuff to enable test-coverage
    # Instrument Program flow should be set to Yes
    # http://stackoverflow.com/questions/7949781/undefined-symbols-for-architecture-i386-upgrading-project-to-ios-5
    set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -Wall -Wextra -Wnon-virtual-dtor -fPIC -O0")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
    # no msvc flags for now
endif()

Enable c++11 for clang release builds

Enable c++11 for clang release builds


unset(_CUB_VERSION_INCLUDE_DIR CACHE) # Clear old result to force search
find_path(_CUB_VERSION_INCLUDE_DIR cub/version.cuh
  NO_DEFAULT_PATH # Only search explicit paths below:
  PATHS
    "${CMAKE_CURRENT_LIST_DIR}/../.."            # Source tree
)
set_property(CACHE _CUB_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)

# Parse version information from version.h in source tree
 # Source tree
set(_CUB_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")
if(EXISTS "${_CUB_VERSION_INCLUDE_DIR}/cub/version.cuh")
  set(_CUB_VERSION_INCLUDE_DIR "${_CUB_VERSION_INCLUDE_DIR}" CACHE FILEPATH "" FORCE) # Clear old result
  set_property(CACHE _CUB_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)
endif()

Remove usage of find_path to locate cub/version.cuh

When a consumer of cub uses the CMake `FIND_ROOT_PATH_MODE_INCLUDE`
option it will cause all find_path searches to only occur under
the find root path. Since this normally doesn't include the
source files, it means that cub-header-search.cmake will fail
to find the cub/version.cuh file.

This issue was found when using conda-build on a project that
includes cub, since conda-build sets up a cross compilation
enviornment including a find root path.


itk_fetch_module(MGHIO
  "MGHIO ImageIO plugin for ITK"
  GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
  GIT_TAG dc1f16c73d497ca2d1d7e1c77096817f8a82eb21
  )

itk_fetch_module(MGHIO
  "MGHIO ImageIO plugin for ITK"
  GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
  GIT_TAG 7d0386335dd90199fa7f1e79db7ceab22d8e957f
  )

Fix MGHIO to fix write failures

BUG: Fix MGHIO to fix write failures

MGHIO was not always writing valid images to disk. This problem was
identified as part of the BRAINSTools use of MGHIO, and resulted
in incorrect data results when using .mgz extension instead of
.nii.gz.  The problem was identified as incorrect direction cosine
manipulation between MGH coordinate space and ITK coordinate space.

In order to facilitate future maintenance, the code was modified
to use itk::Vector and itk::Matrix mathematical operations rather
than c-arrays with manual computations.  This change makes the
code easier to debug (using external matrix calculators) and easier
to validate to the documentation.

More extensive tests created to stress test reading and writing.

Test images converted to/from nifti format for reading and writing
and loaded into slicer to visually confirm that all information is
preserved.

Change-Id: I7a850e2aa6a1938c94326769c415380cf6ee68e8


# NOTE: only add something here if it is really needed by all of kdelibs.
#     Otherwise please prefer adding to the relevant config-foo.h.cmake file,
#     and the CMakeLists.txt that generates it (or a separate ConfigureChecks.make file if you prefer)
#     to minimize recompilations and increase modularity.

include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckTypeSize)
include(CheckCXXSourceCompiles)

#check for libz using the cmake supplied FindZLIB.cmake
FIND_PACKAGE(ZLIB)

IF(ZLIB_FOUND)
	SET(HAVE_ZLIB 1)
ELSE(ZLIB_FOUND)
	SET(HAVE_ZLIB 0)
ENDIF(ZLIB_FOUND)

SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
FIND_PACKAGE(CppUnit)
IF (NOT CPPUNIT_FOUND AND BUILD_TESTS)
	MESSAGE(STATUS "CppUnit not found, disabling tests.")
	SET(BUILD_TESTS OFF)
ENDIF(NOT CPPUNIT_FOUND AND BUILD_TESTS)

# NOTE: only add something here if it is really needed by all of kdelibs.
#     Otherwise please prefer adding to the relevant config-foo.h.cmake file,
#     and the CMakeLists.txt that generates it (or a separate ConfigureChecks.make file if you prefer)
#     to minimize recompilations and increase modularity.

include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckTypeSize)
include(CheckCXXSourceCompiles)

#check for libz using the cmake supplied FindZLIB.cmake
FIND_PACKAGE(ZLIB)

IF(ZLIB_FOUND)
	SET(HAVE_ZLIB 1)
ELSE(ZLIB_FOUND)
	SET(HAVE_ZLIB 0)
ENDIF(ZLIB_FOUND)

SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
FIND_PACKAGE(CppUnit)
IF (NOT CPPUNIT_FOUND AND BUILD_TESTS)
	MESSAGE(STATUS "CppUnit not found, disabling tests.")
	SET(BUILD_TESTS OFF)
ENDIF(NOT CPPUNIT_FOUND AND BUILD_TESTS)

Fix build when building complete kdesupport at once

git-svn-id: 7928e23e4d58c5ca14aa7b47c53aeff82ee1dd0c@740189 283d02a7-25f6-0310-bc7c-ecb5cbfe19da


macro(GroupSources curdir)

    if (MSVC)

    file(GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${curdir} ${CMAKE_CURRENT_SOURCE_DIR}/${curdir}/*)

    foreach(child ${children})

        if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${curdir}/${child})

            if ("${curdir}" STREQUAL "")
                GroupSources(${child})
            else()
                GroupSources(${curdir}/${child})
            endif()
        else()

            string(REPLACE "/" "\\" groupname ${curdir})
            source_group(${groupname} FILES ${CMAKE_CURRENT_SOURCE_DIR}/${curdir}/${child})

        endif()

    endforeach()

    endif()

endmacro()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  set(LINUX TRUE CACHE BOOL "Indicates if host is Linux.")
endif()

Make CMake in Linux work correctly.

Make CMake in Linux work correctly.


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

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

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

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

    set_tests_properties(${BINARY_NAME} PROPERTIES TIMEOUT 240)

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

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

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

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

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

    set_tests_properties(${BINARY_NAME} PROPERTIES TIMEOUT 240)

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

Use protobuf .cc files to compile tests

Use protobuf .cc files to compile tests

--HG--
branch : no_ign_msgs


cmake_minimum_required(VERSION 2.8.6)

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

  set_target_properties(${name} PROPERTIES PREFIX "")

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

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

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

Remove pointless cmake_minimum_required(VERSION ...) statement


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

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

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

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

Update FW with resource allocation fix

Update FW with resource allocation fix