find_package(libfunctionality)
find_package(Boost QUIET)

include("${CMAKE_CURRENT_LIST_DIR}/osvrTargets.cmake")
target_link_libraries(osvr::osvrUtilCpp INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(osvr::osvrClientKitCpp INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(osvr::osvrPluginKitCpp INTERFACE ${Boost_INCLUDE_DIRS})

function(osvr_add_plugin NAME)
    add_library(${NAME} MODULE ${ARGN})
    target_link_libraries(${NAME} osvr::osvrPluginKit)
    set_target_properties(${NAME} PROPERTIES PREFIX "")
endfunction()

find_package(libfunctionality)
find_package(Boost QUIET)

include("${CMAKE_CURRENT_LIST_DIR}/osvrTargets.cmake")
set_property(TARGET osvr::osvrUtilCpp APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
set_property(TARGET osvr::osvrClientKitCpp APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
set_property(TARGET osvr::osvrPluginKitCpp APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})

function(osvr_add_plugin NAME)
    add_library(${NAME} MODULE ${ARGN})
    target_link_libraries(${NAME} osvr::osvrPluginKit)
    set_target_properties(${NAME} PROPERTIES PREFIX "")
endfunction()

Fix CMake config file for building against.


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

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

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

if(BUILD_TESTING)

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

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

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

else()

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

endif(BUILD_TESTING)

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

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

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

if(BUILD_TESTING)

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

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

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

else()

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

endif(BUILD_TESTING)

Use HTTPS protocol instead of SSH

Use HTTPS protocol instead of SSH


add_definitions(
	    --std=c++11

            -Wall
            -Wextra

            -Wno-unknown-pragmas
            -Wno-unused-local-typedefs
            -Wno-unused-variable
        )

if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
    add_definitions(
	-g
	-O0
    )
endif()

if(${CMAKE_BUILD_TYPE} MATCHES "Release")
    add_definitions(
	-O4
    )
endif()

add_definitions(
	    --std=c++11

            -Wall
            -Wextra

            -Wno-unknown-pragmas
            -Wno-unused-local-typedefs
            -Wno-unused-variable
        )

if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
    add_definitions(
	-g
	-O0
    )
endif()

if(${CMAKE_BUILD_TYPE} MATCHES "Release")
    add_definitions(
	-O3
    )
endif()

Define some settings for GCC 4.9

Define some settings for GCC 4.9


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

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

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

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

Update FW: Fix static frame input from host with RGB alignment and stereo


#
# ITK WikiExamples
#

# If the environment var WikiExamplesTag exists, use it
if (NOT DEFINED ENV{WikiExamplesTag})
  # December 26, 2016
  set(GIT_TAG 93b266b8b8a1443ed1dfd47b9b427fce4aebf3b0)
else()
  set(GIT_TAG $ENV{WikiExamplesTag})
endif()

itk_fetch_module(WikiExamples
  "A collection of examples that illustrate how to use ITK."
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKWikiExamples.git
  GIT_TAG ${GIT_TAG}
  )

#
# ITK WikiExamples
#

# If the environment var WikiExamplesTag exists, use it
if (NOT DEFINED ENV{WikiExamplesTag})
  # December 26, 2016
  set(GIT_TAG ef997a295367dbc169118066069748cdf61fdc14)
else()
  set(GIT_TAG $ENV{WikiExamplesTag})
endif()

itk_fetch_module(WikiExamples
  "A collection of examples that illustrate how to use ITK."
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKWikiExamples.git
  GIT_TAG ${GIT_TAG}
  )

ENH: Update Wiki examples for latest code changes

This synchronization provides the latest wiki examples
in preparation for the ITKv5 transition.

The WikiExamples had many compiler warnings, and many ITKv3
backwards compatibility conditionals.

Change-Id: I2572e20a04d13447a7e6dbf53fd8c3fd51667640


set(LASZIP_COMMON_CXX_FLAGS "-Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -isystem /usr/local/include"
)

if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
    if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.7)
       set(CXX_STANDARD "-std=c++0x")
    else()
       set(CXX_STANDARD "-std=c++11")
    endif()
    if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 4.6)
        set(LASZIP_NO_AS_NEEDED_START "-Wl,--no-as-needed")
        set(LASZIP_NO_AS_NEEDED_END "-Wl,--as-needed")
    endif()
    set(LASZIP_COMPILER_GCC 1)
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
    set(CXX_STANDARD "-std=c++11")
    set(LASZIP_COMPILER_CLANG 1)
else()
    message(FATAL_ERROR "Unsupported C++ compiler")
endif()

set (CMAKE_CXX_FLAGS "${LASZIP_COMMON_CXX_FLAGS} ${CXX_STANDARD}")

set(LASZIP_COMMON_CXX_FLAGS "-Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -isystem /usr/local/include"
)

if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
    if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.7)
       set(CXX_STANDARD "-std=c++0x")
    else()
       set(CXX_STANDARD "-std=c++11")
    endif()
    if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 4.6)
        set(LASZIP_NO_AS_NEEDED_START "-Wl,--no-as-needed")
        set(LASZIP_NO_AS_NEEDED_END "-Wl,--as-needed")
    endif()
    set(LASZIP_COMPILER_GCC 1)
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
    set(CXX_STANDARD "-std=c++11")
    set(LASZIP_COMPILER_CLANG 1)
else()
    message(FATAL_ERROR "Unsupported C++ compiler")
endif()

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LASZIP_COMMON_CXX_FLAGS} ${CXX_STANDARD}")

Append CXXFLAGS instead of overwriting them.

This preserves hardening buildflags set in the environment.


# Copyright (c) 2016, Daniel Liew
# This file is covered by the license in LICENSE-SVCB.txt

# This file overrides the default compiler flags for CMake's built-in
# configurations (CMAKE_BUILD_TYPE). Most compiler flags should not be set here.
# The main # purpose is to make sure ``-DNDEBUG`` is never set by default.
if (CMAKE_C_COMPILER_ID)
  set(_lang C)
elseif (CMAKE_CXX_COMPILER_ID)
  set(_lang CXX)
else()
  message(FATAL_ERROR "Unknown language")
endif()

if (("${CMAKE_${_lang}_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_${_lang}_COMPILER_ID}" MATCHES "GNU"))
  # Taken from Modules/Compiler/GNU.cmake but -DNDEBUG is removed
  set(CMAKE_${_lang}_FLAGS_INIT "")
  set(CMAKE_${_lang}_FLAGS_DEBUG_INIT "-g")
  set(CMAKE_${_lang}_FLAGS_MINSIZEREL_INIT "-Os")
  set(CMAKE_${_lang}_FLAGS_RELEASE_INIT "-O3")
  set(CMAKE_${_lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
else()
  message(FATAL_ERROR "Overrides not set for compiler ${CMAKE_${_lang}_COMPILER_ID}")
endif()
unset(_lang)

# Copyright (c) 2016, Daniel Liew
# This file is covered by the license in LICENSE-SVCB.txt

# This file overrides the default compiler flags for CMake's built-in
# configurations (CMAKE_BUILD_TYPE). Most compiler flags should not be set here.
# The main # purpose is to make sure ``-DNDEBUG`` is never set by default.
if (CMAKE_C_COMPILER_ID)
  set(_lang C)
elseif (CMAKE_CXX_COMPILER_ID)
  set(_lang CXX)
else()
  message(FATAL_ERROR "Unknown language")
endif()

if (("${CMAKE_${_lang}_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_${_lang}_COMPILER_ID}" MATCHES "GNU"))
  # Taken from Modules/Compiler/GNU.cmake but -DNDEBUG is removed
  set(CMAKE_${_lang}_FLAGS_INIT "")
  set(CMAKE_${_lang}_FLAGS_DEBUG_INIT "-O0 -g")
  set(CMAKE_${_lang}_FLAGS_MINSIZEREL_INIT "-Os")
  set(CMAKE_${_lang}_FLAGS_RELEASE_INIT "-O3")
  set(CMAKE_${_lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
else()
  message(FATAL_ERROR "Overrides not set for compiler ${CMAKE_${_lang}_COMPILER_ID}")
endif()
unset(_lang)

Debug build should have -O0 passed.

Debug build should have -O0 passed.


#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set(CTEST_PROJECT_NAME "OTB")
set(CTEST_NIGHTLY_START_TIME "20:00:00 CEST")
set(CTEST_DROP_METHOD "https")
set(CTEST_DROP_SITE "dash.orfeo-toolbox.org")
set(CTEST_DROP_LOCATION "/submit.php?project=OTB")
set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 4096)
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 4096)

Allow ctest to log more than 4kb

Allow ctest to log more than 4kb


# CMake file for the clockwork client

find_library(
	ClockworkClient_LIBRARY
	PATHS /opt/latproc/iod/stage/lib /opt/latproc/iod/build
	NAMES cw_client
)

find_path(
	ClockworkClient_INCLUDE_DIR
	ClientInterface.h
	PATHS /opt/latproc/iod/stage /opt/latproc/iod/src
)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ClockworkClient
	DEFAULT_MSG
	ClockworkClient_LIBRARY
	ClockworkClient_INCLUDE_DIR
)

if (ClockworkClient_FOUND)
	set(ClockworkClient_LIBRARIES ${ClockworkClient_LIBRARY})
endif()

mark_as_advanced(ClockworkClient_LIBRARY ClockworkClient_INCLUDE_DIR )

# CMake file for the clockwork client

find_library(
	ClockworkClient_LIBRARY
	PATHS /opt/latproc/iod/stage/lib /opt/latproc/iod/build
	NAMES cw_client Clockwork
)

find_path(
	ClockworkClient_INCLUDE_DIR
	ClientInterface.h
	PATHS /opt/latproc/iod/stage /opt/latproc/iod/src
)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ClockworkClient
	DEFAULT_MSG
	ClockworkClient_LIBRARY
	ClockworkClient_INCLUDE_DIR
)

if (ClockworkClient_FOUND)
	set(ClockworkClient_LIBRARIES ${ClockworkClient_LIBRARY})
endif()

mark_as_advanced(ClockworkClient_LIBRARY ClockworkClient_INCLUDE_DIR )

Fix backward compatibility issue finding the clockwork library


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

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

hunter_add_version(
    PACKAGE_NAME lib-cpp-pre
    VERSION "1.2.2"
    URL "https://github.com/daminetreg/lib-cpp-pre/archive/v1.2.2.tar.gz"
    SHA1 6733a0abd9f74bd67e4ef521e7677ad9437cdba1
)

hunter_add_version(
    PACKAGE_NAME lib-cpp-pre
    VERSION "1.3.2"
    URL "https://github.com/daminetreg/lib-cpp-pre/archive/v1.3.2.tar.gz"
    SHA1 9f7e2e388cfb2ff2aaccd9c1f4c10ba53ffbbf49
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_download(PACKAGE_NAME lib-cpp-pre)

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

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

hunter_add_version(
    PACKAGE_NAME lib-cpp-pre
    VERSION "1.2.2"
    URL "https://github.com/daminetreg/lib-cpp-pre/archive/v1.2.2.tar.gz"
    SHA1 6733a0abd9f74bd67e4ef521e7677ad9437cdba1
)

hunter_add_version(
    PACKAGE_NAME lib-cpp-pre
    VERSION "1.3.2"
    URL "https://github.com/daminetreg/lib-cpp-pre/archive/v1.3.2.tar.gz"
    SHA1 fef5d597594a62f25bc4ae71608d1f0d70f24a56
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_download(PACKAGE_NAME lib-cpp-pre)

Update lib-cpp-pre SHA1sum as we updated it to fix windows compile issues.


include(CMakeParseArguments)

function(add_clang_format TARGET)
  cmake_parse_arguments(args "" "STYLE" "FILES" ${ARGN})

  if(args_STYLE)
    get_filename_component(CFG_FILE ${args_STYLE} ABSOLUTE)
    set(STYLE "-style=file")
    set(STYLE_FILE "-assume-filename=${CFG_FILE}")
  endif()

  list(REMOVE_DUPLICATES args_FILES)
  list(SORT args_FILES)

  find_program(CLANG_FORMAT clang-format)

  if(CLANG_FORMAT)
    add_custom_target("${TARGET}_clangformat"
      COMMAND ${CLANG_FORMAT}
        "-i"
        ${STYLE}
        ${STYLE_FILE}
        ${args_FILES}
      DEPENDS ${args_FILES}
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
      VERBATIM)
    add_dependencies(${TARGET} "${TARGET}_clangformat")
  else()
    message(WARNING "clang-format was not found")
  endif()
endfunction(add_clang_format)

include(CMakeParseArguments)

function(add_clang_format TARGET)
  cmake_parse_arguments(args "" "STYLE" "FILES" ${ARGN})

  if(args_STYLE)
    get_filename_component(CFG_FILE ${args_STYLE} ABSOLUTE)
    set(STYLE "-style=file")
    set(STYLE_FILE "-assume-filename=${CFG_FILE}")
  endif()

  list(REMOVE_DUPLICATES args_FILES)
  list(SORT args_FILES)

  find_program(CLANG_FORMAT clang-format)

  if(CLANG_FORMAT)
    # Query for version.
    execute_process(
      COMMAND ${CLANG_FORMAT} "--version"
      OUTPUT_VARIABLE CLANG_FORMAT_VERSION
      OUTPUT_STRIP_TRAILING_WHITESPACE)
    string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" CLANG_FORMAT_VERSION ${CLANG_FORMAT_VERSION})
  endif()

  set(CLANG_FORMAT_VERSION_PATTERN "6.[0-9]+.[0-9]+")

  if(CLANG_FORMAT AND CLANG_FORMAT_VERSION MATCHES ${CLANG_FORMAT_VERSION_PATTERN})
    add_custom_target("${TARGET}_clangformat"
      COMMAND ${CLANG_FORMAT}
        "-i"
        ${STYLE}
        ${STYLE_FILE}
        ${args_FILES}
      DEPENDS ${args_FILES}
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
      VERBATIM)
    add_dependencies(${TARGET} "${TARGET}_clangformat")
  elseif(CLANG_FORMAT)
    message(WARNING "clang-format version ${CLANG_FORMAT_VERSION} is wrong.\n"
      "Please download and install a version matching \"${CLANG_FORMAT_VERSION_PATTERN}\""
      " from\n  http://releases.llvm.org/download.html\nNote: Also adjust Visual Studio options!")
  else()
    message(WARNING "clang-format was not found")
  endif()
endfunction(add_clang_format)

Add a version check for clang-format.

Add a version check for clang-format.


#
# See CMake/ctkMacroAddCtkLibraryOptions.cmake
#
# This file should list of options available for considered CTK library
# For example: MYOPT1:OFF MYOPT2:ON
#

set(ctk_library_options
  USE_TRANSFER_FUNCTION_CHARTS:ON
  )

#
# See CMake/ctkMacroAddCtkLibraryOptions.cmake
#
# This file should list of options available for considered CTK library
# For example: MYOPT1:OFF MYOPT2:ON
#

set(ctk_library_options
  USE_TRANSFER_FUNCTION_CHARTS:OFF
  )

Disable USE_TRANSFER_FUNCTION_CHARTS by default ctkVTKScalarsToColorsView requires a special API not yet in VTK


# Copyright (c) 2010 Daniel Pfeifer
#               2010-2014, Stefan Eilemann <eile@eyescale.ch>
#               2014, Juan Hernando <jhernando@fi.upm.es>

include(CommonCPPCTest)

if(COVERAGE)
  coverage_report(run_cpp_tests)
  # workaround: 'make test' does not build tests beforehand
  add_custom_target(tests_${PROJECT_NAME} DEPENDS lcov-html)
else()
  add_custom_target(tests_${PROJECT_NAME} DEPENDS run_cpp_tests)
endif()

set_target_properties(tests_${PROJECT_NAME} PROPERTIES FOLDER "Tests")

# Copyright (c) 2010 Daniel Pfeifer
#               2010-2014, Stefan Eilemann <eile@eyescale.ch>
#               2014, Juan Hernando <jhernando@fi.upm.es>

include(CommonCPPCTest)

if(COVERAGE)
  coverage_report(run_cpp_tests)
  # workaround: 'make test' does not build tests beforehand
  add_custom_target(${PROJECT_NAME}_tests DEPENDS lcov-html)
else()
  add_custom_target(${PROJECT_NAME}_tests DEPENDS run_cpp_tests)
endif()

set_target_properties(${PROJECT_NAME}_tests PROPERTIES FOLDER "Tests")

Put PROJECT_NAME first in test rule

Put PROJECT_NAME first in test rule


# - Try to find LCL

# Once done this will define
#  LCL_FOUND - System has LibXml2
#  LCL_INCLUDE_DIRS - The LibXml2 include directories
#  LCL_LIBRARIES - The libraries needed to use LibXml2
#  LCL_DEFINITIONS - Compiler switches required for using LibXml2

find_package(PkgConfig)

find_path(LCL_INCLUDE_DIR headers/TranslationUnit.h
  HINTS "/home/gm/bachelor/lib/"
  "/home/forgie/code/libclangpp/"
  "/home/zalox/bachelor/libclang++/"
  )

find_library(LCL_LIBRARY NAMES testlcl
  HINTS "/home/gm/bachelor/lib/lib/"
  "/home/forgie/code/libclangpp/lib/"
  )

set(LCL_LIBRARIES ${LCL_LIBRARY} )
set(LCL_INCLUDE_DIRS ${LCL_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LCL DEFAULT_MSG
                                  LCL_LIBRARY LCL_INCLUDE_DIR)

mark_as_advanced(LCL_INCLUDE_DIR LCL_LIBRARY )

# - Try to find LCL

# Once done this will define
#  LCL_FOUND - System has LibXml2
#  LCL_INCLUDE_DIRS - The LibXml2 include directories
#  LCL_LIBRARIES - The libraries needed to use LibXml2
#  LCL_DEFINITIONS - Compiler switches required for using LibXml2

find_package(PkgConfig)

find_path(LCL_INCLUDE_DIR headers/TranslationUnit.h
  HINTS "/home/gm/bachelor/lib/"
  "/home/forgie/code/libclangpp/"
  "/home/zalox/bachelor/libclang++/"
  )

find_library(LCL_LIBRARY NAMES testlcl
  HINTS "/home/gm/bachelor/lib/lib/"
  "/home/forgie/code/libclangpp/lib/"
  "/home/zalox/bachelor/libclang++/lib/"
  )

set(LCL_LIBRARIES ${LCL_LIBRARY} )
set(LCL_INCLUDE_DIRS ${LCL_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LCL DEFAULT_MSG
                                  LCL_LIBRARY LCL_INCLUDE_DIR)

mark_as_advanced(LCL_INCLUDE_DIR LCL_LIBRARY )

Add my path to findlcl

Add my path to findlcl


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

find_path(YAML_INCLUDES
  yaml-cpp/yaml.h
  HINTS ${YAML_ROOT} ${CMAKE_INSTALL_PREFIX}
  PATH_SUFFIXES include)

find_library(YAML_LIBRARIES
  NAMES libyaml-cpp.a yaml-cpp
  HINTS ${YAML_ROOT} ${CMAKE_INSTALL_PREFIX}
  PATH_SUFFIXES lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(YAMLCPP DEFAULT_MSG YAML_INCLUDES YAML_LIBRARIES)
mark_as_advanced(YAML_INCLUDES YAML_LIBRARIES)

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

find_path(YAML_INCLUDES
  yaml-cpp/yaml.h
  HINTS ${YAML_ROOT} ${CMAKE_INSTALL_PREFIX}
  PATH_SUFFIXES include)

find_library(YAML_LIBRARIES
  NAMES yaml-cpp libyaml-cpp.a
  HINTS ${YAML_ROOT} ${CMAKE_INSTALL_PREFIX}
  PATH_SUFFIXES lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(YAMLCPP DEFAULT_MSG YAML_INCLUDES YAML_LIBRARIES)
mark_as_advanced(YAML_INCLUDES YAML_LIBRARIES)

Change search order for yaml-cpp library

Buf reported in issue 305


include(DownloadProject)

macro(getRE2C)
    if (CMAKE_VERSION VERSION_LESS 3.2)
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
    else()
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
    endif()

    download_project(
            PROJ                re2c
            GIT_REPOSITORY      https://github.com/skvadrik/re2c.git
            GIT_TAG             1.2
            GIT_PROGRESS        1
    )

    set(RE2C_BIN "${re2c_BINARY_DIR}/re2c")

    if(NOT EXISTS "${re2c_SOURCE_DIR}/configure")
        execute_process(COMMAND ./autogen.sh WORKING_DIRECTORY ${re2c_SOURCE_DIR})
    endif()

    execute_process(COMMAND ${re2c_SOURCE_DIR}/configure WORKING_DIRECTORY ${re2c_BINARY_DIR})
    execute_process(COMMAND make WORKING_DIRECTORY ${re2c_BINARY_DIR})
endmacro()

include(DownloadProject)

macro(getRE2C)
    if (CMAKE_VERSION VERSION_LESS 3.2)
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
    else()
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
    endif()

    download_project(
            PROJ                re2c
            GIT_REPOSITORY      https://github.com/skvadrik/re2c.git
            GIT_TAG             1.1.1
            GIT_PROGRESS        1
    )

    set(RE2C_BIN "${re2c_BINARY_DIR}/re2c")

    if(NOT EXISTS "${re2c_SOURCE_DIR}/re2c/configure")
        execute_process(COMMAND ./autogen.sh WORKING_DIRECTORY ${re2c_SOURCE_DIR}/re2c)
    endif()

    execute_process(COMMAND ${re2c_SOURCE_DIR}/re2c/configure WORKING_DIRECTORY ${re2c_BINARY_DIR})
    execute_process(COMMAND make WORKING_DIRECTORY ${re2c_BINARY_DIR})
endmacro()

Revert "update re2c to 1.2" due to build error in some environment like
Mac or openSUSE tumbleweed

This reverts commit f8e43c07682f2e8a13294d89aa1d28186dbd8620.


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

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

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

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

Update FW: fix for 4-point warp with normalized = false


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

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

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

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

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

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

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

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

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

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

ENH: Update BridgeNumPy to most recent version (2017.03.05)

 Matt McCormick (2):
       COMP: Address Python 2.7 Windows hypot bug
       DOC: Add example usage in the README

Change-Id: I24c1b860f877bb4c3564e51c547ef60375ce4148


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

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

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

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

Update FW with bilateral fix

Update FW with bilateral fix


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

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

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

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

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

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

cmake: Create the compile command database by default.

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


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

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

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

if(BUILD_TESTING)

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

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

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

else()

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

endif(BUILD_TESTING)

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

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

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

if(BUILD_TESTING)

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

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

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

else()

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

endif(BUILD_TESTING)

Revert to previous behaviour due to proxy issues


/* Define if you have valgrind.h installed */
#cmakedefine HAVE_VALGRIND_H 1

/* Define to compile with GSM SMS support */
/* #undef INCLUDE_SMSGSM */

/* Define to 1 if you want libv4l support */
#cmakedefine HAVE_LIBV4L2 1

#cmakedefine HAVE_V4L 1

/* Define if you have valgrind.h installed */
#cmakedefine HAVE_VALGRIND_H 1

/* Define to 1 if you want libv4l support */
#cmakedefine HAVE_LIBV4L2 1

#cmakedefine HAVE_V4L 1

Remove INCLUDE_SMSGSM because it is not used


add_python_test(homepage PLUGIN homepage)

add_python_style_test(python_static_analysis_homepage
    "${PROJECT_SOURCE_DIR}/plugins/homepage/server")

add_python_style_test(python_static_analysis_homepage_tests
    "${PROJECT_SOURCE_DIR}/plugins/homepage/plugin_tests")

add_eslint_test(homepage
    "${PROJECT_SOURCE_DIR}/plugins/homepage/web_client/js/src")

add_python_test(homepage PLUGIN homepage)

add_python_style_test(python_static_analysis_homepage
    "${PROJECT_SOURCE_DIR}/plugins/homepage/server")

add_python_style_test(python_static_analysis_homepage_tests
    "${PROJECT_SOURCE_DIR}/plugins/homepage/plugin_tests")

add_eslint_test(homepage
    "${PROJECT_SOURCE_DIR}/plugins/homepage/web_client/js")

Fix path in cmake file

Fix path in cmake file


function(mouve_add_plugin _name)
    add_library(${_name} MODULE ${ARGN})
    target_link_libraries(${_name} PRIVATE Mouve.Logic)
    target_include_directories(${_name} PRIVATE ${mouve_SOURCE_DIR})

    if(MSVC) # We should really check for multi-config generator
        foreach(config ${CMAKE_CONFIGURATION_TYPES})
            string(TOUPPER ${config} configUpper)
            set_target_properties(${_name}
                PROPERTIES
                    LIBRARY_OUTPUT_DIRECTORY_${configUpper} ${CMAKE_BINARY_DIR}/bin/${config}/plugins
            )
        endforeach()
    else()
        set_target_properties(${_name}
            PROPERTIES
                LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/plugins

        )
    endif()

    install(TARGETS ${_name}
        RUNTIME DESTINATION bin/plugins
        LIBRARY DESTINATION bin/plugins
        ARCHIVE DESTINATION lib/plugins
    )
endfunction()

macro(mouve_bin_directory _config _directory)
    if(MSVC) # We should really check for multi-config generator
        set(${_directory} ${CMAKE_BINARY_DIR}/bin/${_config})
    else()
        set(${_directory} ${CMAKE_BINARY_DIR}/bin)
    endif()
endmacro()

function(mouve_add_plugin _name)
    add_library(${_name} MODULE ${ARGN})
    target_link_libraries(${_name} PRIVATE Mouve.Logic)
    target_include_directories(${_name} PRIVATE ${mouve_SOURCE_DIR})

    if(MSVC) # We should really check for multi-config generator
        foreach(config ${CMAKE_CONFIGURATION_TYPES})
            string(TOUPPER ${config} configUpper)
            mouve_bin_directory(${config} directory)
            set_target_properties(${_name} PROPERTIES
                LIBRARY_OUTPUT_DIRECTORY_${configUpper} ${directory}/plugins
            )
        endforeach()
    else()
        mouve_bin_directory(${CMAKE_BUILD_TYPE} directory)
        set_target_properties(${_name} PROPERTIES
            LIBRARY_OUTPUT_DIRECTORY ${directory}/plugins
        )
    endif()

    install(TARGETS ${_name}
        RUNTIME DESTINATION bin/plugins
        LIBRARY DESTINATION bin/plugins
        ARCHIVE DESTINATION lib/plugins
    )
endfunction()

Add macro for getting bin output directory


set(CTEST_SOURCE_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}")
set(CTEST_BINARY_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}/_build")

include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(test_group "$ENV{GIRDER_TEST_GROUP}")
set(CTEST_SITE "Travis")
set(CTEST_BUILD_NAME "Linux-$ENV{TRAVIS_BRANCH}-Mongo-$ENV{MONGO_VERSION}-${test_group}")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")

ctest_start("Continuous")
ctest_configure()
ctest_build()

if(test_group STREQUAL python)
  ctest_test(
    PARALLEL_LEVEL 4 RETURN_VALUE res
    INCLUDE_LABEL girder_python
  )
elseif(test_group STREQUAL browser)
  ctest_test(
    PARALLEL_LEVEL 1 RETURN_VALUE res
    EXCLUDE_LABEL girder_python
  )
  file(RENAME "${CTEST_BINARY_DIRECTORY}/coverage/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
endif()

ctest_coverage()

file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()

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

set(CTEST_SOURCE_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}")
set(CTEST_BINARY_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}/_build")

include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(test_group "$ENV{GIRDER_TEST_GROUP}")
set(CTEST_SITE "Travis")
set(CTEST_BUILD_NAME "Linux-$ENV{TRAVIS_BRANCH}-Mongo-$ENV{MONGO_VERSION}-${test_group}")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")

ctest_start("Continuous")
ctest_configure()
ctest_build()

if(test_group STREQUAL python)
  ctest_test(
    PARALLEL_LEVEL 4 RETURN_VALUE res
    INCLUDE_LABEL girder_python
  )
elseif(test_group STREQUAL browser)
  ctest_test(
    PARALLEL_LEVEL 2 RETURN_VALUE res
    EXCLUDE_LABEL girder_python
  )
  file(RENAME "${CTEST_BINARY_DIRECTORY}/coverage/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
endif()

ctest_coverage()

file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()

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

Set web client tests parallel level to 2 on travis


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

TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES(
  BoostOrg
  REQUIRED_HEADERS boost/version.hpp boost/mpl/at.hpp
  REQUIRED_LIBS_NAMES boost_mpi boost_serialization
  )

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

Use CMake FindBoost module to check that the version is at least 1.62.0


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

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

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

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

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

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

Update FW to match depthai-shared

Update FW to match depthai-shared


# -*- 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_linux-gcc-4.0.1_libmt.a)
  elseif (LINUX)
    set(JSONCPP_LIBRARIES libjsoncpp.a)
  endif (WINDOWS)
  set(JSONCPP_INCLUDE_DIRS "${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)
    set(JSONCPP_LIBRARIES libjsoncpp.a)
  endif (WINDOWS)
  set(JSONCPP_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
endif (STANDALONE)

Fix Mac Json cmake script

Fix Mac Json cmake script


macro(def_test testName)
    add_executable(Test${testName} Test${testName}.cpp ${COMMON_SOURCES})
    target_link_libraries(Test${testName} ${TEST_LIBS} ${GTEST_BOTH_LIBRARIES})
    add_test(Test${testName} Test${testName})
    set_tests_properties(Test${testName} PROPERTIES LABELS unit)
endmacro(def_test testName)

macro(def_test testName)
    add_executable(Test${testName} Test${testName}.cpp ${COMMON_SOURCES})
    target_link_libraries(Test${testName} ${TEST_LIBS} ${GTEST_BOTH_LIBRARIES})
    if($ENV{BC_UNIT_TEST_VG})
        add_test(NAME Test${testName} COMMAND valgrind --error-exitcode=1 $<TARGET_FILE:Test${testName}>)
    else()
        add_test(NAME Test${testName} COMMAND Test${testName})
    endif()

    set_tests_properties(Test${testName} PROPERTIES LABELS unit)
endmacro(def_test testName)

Add new environment variable: BC_UNIT_TEST_VG

When set, unit tests will be run through valgrind


set(Boost_Install_Dir ${CMAKE_CURRENT_BINARY_DIR}/boost-install)
set(Boost_Configure_Script ${CMAKE_CURRENT_LIST_DIR}/configureboost.cmake)
set(Boost_Build_Script ${CMAKE_CURRENT_LIST_DIR}/buildboost.cmake)

ExternalProject_add(Boost
  SVN_REPOSITORY http://svn.boost.org/svn/boost/trunk
  SVN_REVISION -r "77936"
#  URL http://sourceforge.net/projects/boost/files/boost/1.49.0/boost_1_49_0.tar.gz
#  URL_MD5 e0defc8c818e4f1c5bbb29d0292b76ca
  SOURCE_DIR Boost
  "${cmakeversion_external_update}"
  CONFIGURE_COMMAND ${CMAKE_COMMAND}
  -DBUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/Boost
  -DBOOST_INSTALL_DIR:PATH=${Boost_Install_Dir}
  -P ${Boost_Configure_Script}
  INSTALL_COMMAND ""
  BUILD_IN_SOURCE 1
  BUILD_COMMAND ${CMAKE_COMMAND}
  -DBUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/Boost
  -DBOOST_INSTALL_DIR:PATH=${Boost_Install_Dir} -P ${Boost_Build_Script}
)
set(BOOST_ROOT ${CMAKE_CURRENT_BINARY_DIR}/boost-install)

set(BOOST_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/boost-install/include)

set(Boost_Install_Dir ${CMAKE_CURRENT_BINARY_DIR}/boost-install)
set(Boost_Configure_Script ${CMAKE_CURRENT_LIST_DIR}/configureboost.cmake)
set(Boost_Build_Script ${CMAKE_CURRENT_LIST_DIR}/buildboost.cmake)

ExternalProject_add(Boost
  SVN_REPOSITORY http://svn.boost.org/svn/boost/trunk
  SVN_REVISION -r "82586"
#  URL http://sourceforge.net/projects/boost/files/boost/1.49.0/boost_1_49_0.tar.gz
#  URL_MD5 e0defc8c818e4f1c5bbb29d0292b76ca
  SOURCE_DIR Boost
  "${cmakeversion_external_update}"
  CONFIGURE_COMMAND ${CMAKE_COMMAND}
  -DBUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/Boost
  -DBOOST_INSTALL_DIR:PATH=${Boost_Install_Dir}
  -P ${Boost_Configure_Script}
  INSTALL_COMMAND ""
  BUILD_IN_SOURCE 1
  BUILD_COMMAND ${CMAKE_COMMAND}
  -DBUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/Boost
  -DBOOST_INSTALL_DIR:PATH=${Boost_Install_Dir} -P ${Boost_Build_Script}
)
set(BOOST_ROOT ${CMAKE_CURRENT_BINARY_DIR}/boost-install)

set(BOOST_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/boost-install/include)

COMP: Update boost to avoid compiler issues with clang.


# AliRoot Build System Module to find and configure DATE
#
# Author: Johny Jose (johny.jose@cern.ch)
#         Port of previous Makefile build to cmake

cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)

find_program(DATE_CONFIG date-config)
message(STATUS "Check for Date : ${DATE_CONFIG}")
if(DATE_CONFIG)
  set(DATE_FOUND TRUE)
  set(DATE_ROOT $ENV{DATE_ROOT})
  set(DATE_COMMON_DEFS $ENV{DATE_COMMON_DEFS})
  set(DATE_MONITOR_DIR $ENV{DATE_MONITOR_DIR})
  execute_process(COMMAND date-config --cflags OUTPUT_VARIABLE DATEFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
  execute_process(COMMAND date-config --monitorlibs OUTPUT_VARIABLE DMONLIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
  set(DATEFLAGS "-D${CMAKE_SYSTEM_NAME} -DDATE_SYS=${CMAKE_SYSTEM_NAME} -Dlong32='int' -Dlong64='long long' -DdatePointer='long'")
endif(DATE_CONFIG)
string ( REPLACE "\\" "" DATEFLAGS "${DATEFLAGS}" )
message(STATUS "DATEFLAGS: ${DATEFLAGS}")

# AliRoot Build System Module to find and configure DATE
#
# Author: Johny Jose (johny.jose@cern.ch)
#         Port of previous Makefile build to cmake

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

find_program(DATE_CONFIG date-config)
message(STATUS "Check for Date : ${DATE_CONFIG}")
if(DATE_CONFIG)
  set(DATE_FOUND TRUE)
  set(DATE_ROOT $ENV{DATE_ROOT})
  set(DATE_COMMON_DEFS $ENV{DATE_COMMON_DEFS})
  set(DATE_MONITOR_DIR $ENV{DATE_MONITOR_DIR})
  execute_process(COMMAND date-config --cflags OUTPUT_VARIABLE DATEFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
  string(REGEX REPLACE "\"" "'" DATEFLAGS ${DATEFLAGS})
  set(DATEFLAGS "-DALI_DATE ${DATEFLAGS}")
  execute_process(COMMAND date-config --monitorlibs OUTPUT_VARIABLE DMONLIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
  set(DATEFLAGS "-D${CMAKE_SYSTEM_NAME} -DDATE_SYS=${CMAKE_SYSTEM_NAME} -Dlong32='int' -Dlong64='long long' -DdatePointer='long'")
endif(DATE_CONFIG)

Revert of a harmful change (A.Goel)

Revert of a harmful change (A.Goel)


#
# Default dependencies for the runtime-package
#

# Install 3rd-party runtime dependencies into runtime-component
# install(FILES ... COMPONENT runtime)

#
# Full dependencies for self-contained packages
#

if(OPTION_SELF_CONTAINED)

    # Install 3rd-party runtime dependencies into runtime-component
    # install(FILES ... COMPONENT runtime)

endif()

# [WIP]

# Paths to executables
#set(apps
#    "\${CMAKE_INSTALL_PREFIX}/${INSTALL_BIN}/fibgui${CMAKE_EXECUTABLE_SUFFIX}"
#)

#install(CODE "
#    include(\"${CMAKE_ROOT}/Modules/GetPrerequisites.cmake\")

#    foreach(app ${apps})
#        message(\"Dependencies for \${app}\")

#        get_prerequisites(\${app} prereqs 1 1 \"\" \"\")
#        foreach(lib \${prereqs})
#            message(\"- \${lib}\")
#        endforeach(lib)
#    endforeach(app)
#    "
#    COMPONENT runtime
#)

Remove unfinished code for release

Remove unfinished code for release


# message("In package CTK config")
find_package(CTK REQUIRED)
list(APPEND ALL_INCLUDE_DIRECTORIES ${CTK_INCLUDE_DIRS})
list(APPEND ALL_LIBRARIES ${CTK_LIBRARIES})
link_directories(${CTK_LIBRARY_DIRS} ${CTK_EXTERNAL_LIBRARY_DIRS})

# Temporary workaround for CTK bug of not exposing external project library dirs.
# Should be removed as soon as this is fixed in CTK. (espakm)
if(EXISTS "${CTK_DIR}/qRestAPI-build/qRestAPIConfig.cmake")
  include(${CTK_DIR}/qRestAPI-build/qRestAPIConfig.cmake)
  link_directories(${qRestAPI_LIBRARY_DIRS})
endif()
if(EXISTS "${CTK_DIR}/QuaZip-build/QuaZipConfig.cmake")
  include(${CTK_DIR}/QuaZip-build/QuaZipConfig.cmake)
  link_directories(${QUAZIP_LIBRARY_DIRS})
endif()

Revert workaround for CTK external library dirs


macro(buildCurl)
  include(ExternalProject)

  set(SECURE_TRANSPORT_FLAGS "")
  if(APPLE)
    set(SECURE_TRANSPORT_FLAG "--with-secure-transport")
  endif()

  ExternalProject_Add(BuildCurlBundled
      SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/curl"
      PREFIX "${CMAKE_BINARY_DIR}/curl"
      BUILD_IN_SOURCE 1
      CONFIGURE_COMMAND bash -c "autoreconf -i && ./configure  --prefix=${CMAKE_CURRENT_BINARY_DIR}/curl --disable-ldap --disable-ldaps ${SECURE_TRANSPORT_FLAGS} && ${CMAKE_SOURCE_DIR}/patch-curl-clock-gettime.sh"
      BUILD_COMMAND ${MAKE}
  )

  add_library(libcurl STATIC IMPORTED)
  set_property(TARGET libcurl PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/curl/lib/libcurl.a)
  add_dependencies(libcurl BuildCurlBundled)
  set(CURL_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/curl/include)
endmacro()

macro(buildCurl)
  include(ExternalProject)

  set(SECURE_TRANSPORT_FLAGS "")
  if(APPLE)
    set(SECURE_TRANSPORT_FLAGS "--with-secure-transport")
  endif()

  ExternalProject_Add(BuildCurlBundled
      SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/curl"
      PREFIX "${CMAKE_BINARY_DIR}/curl"
      BUILD_IN_SOURCE 1
      CONFIGURE_COMMAND bash -c "autoreconf -i && ./configure  --prefix=${CMAKE_CURRENT_BINARY_DIR}/curl --disable-ldap --disable-ldaps ${SECURE_TRANSPORT_FLAGS} && ${CMAKE_SOURCE_DIR}/patch-curl-clock-gettime.sh"
      BUILD_COMMAND ${MAKE}
  )

  add_library(libcurl STATIC IMPORTED)
  set_property(TARGET libcurl PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/curl/lib/libcurl.a)
  add_dependencies(libcurl BuildCurlBundled)
  set(CURL_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/curl/include)
endmacro()

Fix typo in variable activating secure transport


# TODO(thomthom): Configure for Mac:
include_directories(SYSTEM "${SLAPI_INCLUDE_PATH}")
include_directories("${CPP_API_INCLUDE_PATH}")

file(GLOB_RECURSE CPP_API_HEADERS ${CPP_API_INCLUDE_PATH}/*.hpp)
file(GLOB_RECURSE CPP_API_SOURCES ${CPP_API_SOURCE_PATH}/*.cpp)

add_library(SketchUpAPICpp STATIC ${CPP_API_HEADERS} ${CPP_API_SOURCES})
target_link_libraries(SketchUpAPICpp LINK_PUBLIC SLAPI_LIB)

# https://stackoverflow.com/a/14235055/486990
if ( MSVC )
  # TODO(thomthom): Enable /W4 when the warnings it trigger is addressed.
  # target_compile_options(SketchUpAPICpp PRIVATE "/W4")
  target_compile_options(SketchUpAPICpp PRIVATE "/W3")
  target_compile_options(SketchUpAPICpp PRIVATE "/WX")
  target_compile_options(SketchUpAPICpp PRIVATE "/MP")
else()
  # target_compile_options(SketchUpAPICpp PRIVATE "-Wall")
  target_compile_options(SketchUpAPICpp PRIVATE "-Wno-missing-braces")
  target_compile_options(SketchUpAPICpp PRIVATE "-Werror")
endif()

source_group(
  TREE "${CPP_API_INCLUDE_PATH}/${CPP_API_BASENAME}"
  PREFIX "Header Files"
  FILES ${CPP_API_HEADERS}
)
source_group(
  TREE "${CPP_API_SOURCE_PATH}/${CPP_API_BASENAME}"
  PREFIX "Source Files"
  FILES ${CPP_API_SOURCES}
)

# TODO(thomthom): Configure for Mac:
include_directories(SYSTEM "${SLAPI_INCLUDE_PATH}")
include_directories("${CPP_API_INCLUDE_PATH}")

file(GLOB_RECURSE CPP_API_HEADERS ${CPP_API_INCLUDE_PATH}/*.hpp)
file(GLOB_RECURSE CPP_API_SOURCES ${CPP_API_SOURCE_PATH}/*.cpp)

add_library(SketchUpAPICpp STATIC ${CPP_API_HEADERS} ${CPP_API_SOURCES})

# https://stackoverflow.com/a/14235055/486990
if ( MSVC )
  # TODO(thomthom): Enable /W4 when the warnings it trigger is addressed.
  # target_compile_options(SketchUpAPICpp PRIVATE "/W4")
  target_compile_options(SketchUpAPICpp PRIVATE "/W3")
  target_compile_options(SketchUpAPICpp PRIVATE "/WX")
  target_compile_options(SketchUpAPICpp PRIVATE "/MP")
else()
  # target_compile_options(SketchUpAPICpp PRIVATE "-Wall")
  target_compile_options(SketchUpAPICpp PRIVATE "-Wno-missing-braces")
  target_compile_options(SketchUpAPICpp PRIVATE "-Werror")
endif()

source_group(
  TREE "${CPP_API_INCLUDE_PATH}/${CPP_API_BASENAME}"
  PREFIX "Header Files"
  FILES ${CPP_API_HEADERS}
)
source_group(
  TREE "${CPP_API_SOURCE_PATH}/${CPP_API_BASENAME}"
  PREFIX "Source Files"
  FILES ${CPP_API_SOURCES}
)

Revert changes - don't need target_link_libraries


# Copyright (C) 2010 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#Enable 64 bit file offsets
SET(_LARGE_FILES 1)

# Fix xlC oddity - it complains about same inline function defined multiple times
# in different compilation units
INCLUDE(CheckCXXCompilerFlag)
 CHECK_CXX_COMPILER_FLAG("-qstaticinline" HAVE_QSTATICINLINE)
 IF(HAVE_QSTATICINLINE)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qstaticinline")
 ENDIF()

# The following is required to export all symbols
# (also with leading underscore)
STRING(REPLACE  "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS
  ${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}")
STRING(REPLACE  "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS
  "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")

# Copyright (C) 2010 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#Enable 64 bit file offsets
SET(_LARGE_FILES 1)

# Fix xlC oddity - it complains about same inline function defined multiple times
# in different compilation units
INCLUDE(CheckCXXCompilerFlag)
 CHECK_CXX_COMPILER_FLAG("-qstaticinline" HAVE_QSTATICINLINE)
 IF(HAVE_QSTATICINLINE)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qstaticinline")
 ENDIF()

# The following is required to export all symbols
# (also with leading underscore)
STRING(REPLACE  "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS
  "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}")
STRING(REPLACE  "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS
  "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")

Fix syntax error (missing quote).

Fix syntax error (missing quote).


# Allow to easily build test suites

macro(create_test_suite NAME)
	enable_testing()
	set(TARGET "check-${NAME}")
	add_custom_target(${TARGET} COMMAND ${CMAKE_CTEST_COMMAND})

	# If the magic target check-all exists, attach to it.
	if(TARGET check-all)
		add_dependencies(check-all ${TARGET})
	endif()
endmacro(create_test_suite)

function(add_test_to_suite SUITE NAME)
	add_executable(${NAME} EXCLUDE_FROM_ALL ${ARGN})
	add_test(${NAME} ${NAME} COMMAND ${NAME})
	add_dependencies("check-${SUITE}" ${NAME})
endfunction(add_test_to_suite)

# Allow to easily build test suites

macro(create_test_suite NAME)
	enable_testing()
	set(TARGET "check-${NAME}")
	add_custom_target(${TARGET} COMMAND ${CMAKE_CTEST_COMMAND})

	# If the magic target check-all exists, attach to it.
	if(TARGET check-all)
		add_dependencies(check-all ${TARGET})
	endif()
endmacro(create_test_suite)

function(add_test_to_suite SUITE NAME)
	add_executable(${NAME} EXCLUDE_FROM_ALL ${ARGN})
	add_test(${NAME} ${NAME})
	add_dependencies("check-${SUITE}" ${NAME})
endfunction(add_test_to_suite)

Fix test run command line

[cmake] Fix test run command line

Summary: Useless arguement are passed to test, which is ok most of the time as they ignore it, but sometime, it's not.

Test Plan:
Change the command line for ctest to pass the -V flag.

  ninja check

Ensure no superfluous flags are passed.

Reviewers: #bitcoin_abc, schancel

Reviewed By: #bitcoin_abc, schancel

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1273


macro(buildCurl)
  include(ExternalProject)

  set(SECURE_TRANSPORT_FLAGS "")
  if(APPLE)
    set(SECURE_TRANSPORT_FLAGS "-DCMAKE_USE_SECTRANSP=ON -DCMAKE_USE_OPENSSL=OFF")
  endif()

  ExternalProject_Add(BuildCurlBundled
      SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/curl"
      BINARY_DIR "${CMAKE_BINARY_DIR}/deps/curl"
      PREFIX "${CMAKE_BINARY_DIR}/deps/curl"
      CONFIGURE_COMMAND bash -c "${CMAKE_COMMAND} -DHTTP_ONLY=ON -DBUILD_CURL_EXE=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_USE_LIBSSH2=OFF ${CMAKE_SOURCE_DIR}/deps/curl && ${CMAKE_SOURCE_DIR}/patch-curl-clock-gettime.sh"
      BUILD_COMMAND make
      INSTALL_COMMAND make DESTDIR=${CMAKE_BINARY_DIR}/deps/curl-install install
  )

  add_library(libcurl STATIC IMPORTED)
  set_property(TARGET libcurl PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/deps/curl-install/usr/local/lib/libcurl.a)
  add_dependencies(libcurl BuildCurlBundled)

  # Replace with the following when possible:
  # target_include_directories(libcurl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/deps/curl/include)
  set_property(TARGET libcurl APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/deps/curl/include)

endmacro()

macro(buildCurl)
  include(ExternalProject)

  set(SECURE_TRANSPORT_FLAGS "")
  if(APPLE)
    set(SECURE_TRANSPORT_FLAGS "-DCMAKE_USE_SECTRANSP=ON -DCMAKE_USE_OPENSSL=OFF")
  endif()

  ExternalProject_Add(BuildCurlBundled
      SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/curl"
      BINARY_DIR "${CMAKE_BINARY_DIR}/deps/curl"
      PREFIX "${CMAKE_BINARY_DIR}/deps/curl"
      CONFIGURE_COMMAND bash -c "${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=/ -DCMAKE_INSTALL_LIBDIR=lib -DHTTP_ONLY=ON -DBUILD_CURL_EXE=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_USE_LIBSSH2=OFF ${SECURE_TRANSPORT_FLAGS} ${CMAKE_SOURCE_DIR}/deps/curl && ${CMAKE_SOURCE_DIR}/patch-curl-clock-gettime.sh"
      BUILD_COMMAND make
      INSTALL_COMMAND make DESTDIR=${CMAKE_BINARY_DIR}/deps/curl-install install
  )

  add_library(libcurl STATIC IMPORTED)
  set_property(TARGET libcurl PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/deps/curl-install/usr/lib/libcurl.a)
  add_dependencies(libcurl BuildCurlBundled)

  # Replace with the following when possible:
  # target_include_directories(libcurl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/deps/curl/include)
  set_property(TARGET libcurl APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/deps/curl/include)

endmacro()

Fix bundled curl's installation paths

Fix bundled curl's installation paths


# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "Setting build type to 'Debug' as none was specified.")
  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
  # Set the possible values of build type for cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
    "MinSizeRel" "RelWithDebInfo")
endif()

# Set a default build type if none was specified
set(default_build_type "Release")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  set(default_build_type "Debug")
endif()

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
  set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
      STRING "Choose the type of build." FORCE)
  # Set the possible values of build type for cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
    "MinSizeRel" "RelWithDebInfo")
endif()

Make the default build type a little cleverer

Detect the presence of the .git directory, if present default to a Debug
build, otherwise default to a Release build for source tarballs.


# vim: set ts=2 sts=2 sw=2 fdm=indent
###############################################################################
# Author: Jacky Alciné <me@jalcine.me>
#
# Wintermute is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# Wintermute is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with Wintermute; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
###############################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)

if (NOT DEFINED _wntr_func_deps)
  set(_wntr_func_deps ON)
else()
  return()
endif()

include(CheckFunctionExists)

CHECK_FUNCTION_EXISTS(basename CFE_basename)
CHECK_FUNCTION_EXISTS(getenv CFE_getenv)
CHECK_FUNCTION_EXISTS(setenv CFE_setenv)

Check for 3 UNIX methods we use.

[cmake] Check for 3 UNIX methods we use.


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

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

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

# Set up RPATH for the project too.
option(ENABLE_RPATH "Enable rpath support on Linux and Mac" ON)
if(UNIX AND ENABLE_RPATH)
  set(CMAKE_SKIP_BUILD_RPATH FALSE)
  set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

Remove the special rpath for Apple

Remove the special rpath for Apple

This was causing issues with packaging, and will need some work if it is
even necessary with our packaging process.

Change-Id: I6a90184872a18dc588927d30186a50cf7ab7b71d


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

include(ExternalProject)

if(TARGET flatbuffers OR NOT DOWNLOAD_FLATBUFFERS)
  return()
endif()

set(version c957550511689e1052059fc2cf2e43a06a24a05b)

ExternalProject_Add(
  flatbuffers

  DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  DOWNLOAD_NAME flatbuffers-${version}.tar.gz
  URL https://github.com/google/flatbuffers/archive/${version}.tar.gz

  PREFIX ${PROJECT_BINARY_DIR}

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

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

include(ExternalProject)

if(TARGET flatbuffers OR NOT DOWNLOAD_FLATBUFFERS)
  return()
endif()

set(version 97ffc590e336b800d346bdf2f4876394bb353f97)

ExternalProject_Add(
  flatbuffers

  DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  DOWNLOAD_NAME flatbuffers-${version}.tar.gz
  URL https://github.com/google/flatbuffers/archive/${version}.tar.gz

  PREFIX ${PROJECT_BINARY_DIR}

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

Update Flatbuffers to include CPack fix

Update Flatbuffers to include CPack fix

Flatbuffers had a problem with CPack, which has been fixed with the indicated commit. This does update flatbuffers to the latest, so there are potentially other changes being included, but the tests all seem to be passing without issue.

PiperOrigin-RevId: 301444797


prefix=${CMAKE_INSTALL_PREFIX}
exec_prefix=${EXEC_INSTALL_PREFIX}
libdir=${LIB_INSTALL_DIR}
includedir=${INCLUDE_INSTALL_DIR}

Name: ${PROJECT_NAME}
Description: Audio fingerprint library
URL: http://wiki.acoustid.org/wiki/Chromaprint
Version: ${PROJECT_VERSION}
Libs: -L${LIB_INSTALL_DIR} -lchromaprint
Cflags: -I${INCLUDE_INSTALL_DIR}

prefix=${CMAKE_INSTALL_PREFIX}
exec_prefix=${EXEC_INSTALL_PREFIX}
libdir=${LIB_INSTALL_DIR}
includedir=${INCLUDE_INSTALL_DIR}

Name: ${PROJECT_NAME}
Description: Audio fingerprint library
URL: http://acoustid.org/chromaprint
Version: ${PROJECT_VERSION}
Libs: -L${LIB_INSTALL_DIR} -lchromaprint
Cflags: -I${INCLUDE_INSTALL_DIR}

Fix the URL to the Chromaprint page

Fix the URL to the Chromaprint page


set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

configure_file(
    ${${PACKAGE_NAME}_SOURCE_DIR}/cmake/.ycm_extra_conf.py.in
    ${${PACKAGE_NAME}_SOURCE_DIR}/.ycm_extra_conf.py
    @ONLY
)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable/Disable output of compile commands during generation." FORCE)

configure_file(
    ${${PACKAGE_NAME}_SOURCE_DIR}/cmake/.ycm_extra_conf.py.in
    ${${PACKAGE_NAME}_SOURCE_DIR}/.ycm_extra_conf.py
    @ONLY
)

Fix output of compile commands by CMake for YouCompleteMe


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

set(CTEST_DROP_METHOD "http")

set(CTEST_DROP_SITE "rubens")
set(CTEST_DROP_LOCATION "/cdash/submit.php?project=Vigra")
set(CTEST_DROP_SITE_CDASH TRUE)

SET(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes")

Enable tracing memory errors with ctest-valgrind also for tests controlled by shell scripts.


# Version info
set(SimpleITK_Major 0)
set(SimpleITK_Minor 0)
set(SimpleITK_Patch 0)

include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_describe(GIT_TAG)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Code/Common/src/sitkVersion.cxx.in" "${CMAKE_CURRENT_BINARY_DIR}/Code/Common/src/sitkVersion.cxx" @ONLY)

# Version info
set(SimpleITK_Major 0)
set(SimpleITK_Minor 1)
set(SimpleITK_Patch 0)

include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_describe(GIT_TAG)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Code/Common/src/sitkVersion.cxx.in" "${CMAKE_CURRENT_BINARY_DIR}/Code/Common/src/sitkVersion.cxx" @ONLY)

ENH: Update to version 0.1.0 for alpha 1 (va01)

This tag corresponds to ITK tag "v4.0a08".


set(hooks_directory
  "${vistk_source_dir}/.git/hooks")

add_custom_command(
  OUTPUT  "${hooks_directory}/.git"
  COMMAND "${GIT_EXECUTABLE}"
          init
  COMMAND "${GIT_EXECUTABLE}"
          remote add origin
          ../..
  WORKING_DIRECTORY
          "${hooks_directory}"
  COMMENT "Initializing the hooks repository")
add_custom_target(hooks-init
  DEPENDS
    "${hooks_directory}/.git")

add_custom_target(hooks-update ALL
  DEPENDS
    hooks-init)
add_custom_command(
  TARGET  hooks-update
  COMMAND "${GIT_EXECUTABLE}"
          fetch
          --quiet
          origin
          remotes/origin/hooks
  COMMAND "${GIT_EXECUTABLE}"
          merge
          --quiet
          FETCH_HEAD
  WORKING_DIRECTORY
          "${hooks_directory}"
  COMMENT "Updating hooks repository")

set(hooks_directory
  "${vistk_source_dir}/.git/hooks")

add_custom_command(
  OUTPUT  "${hooks_directory}/.git"
  COMMAND "${GIT_EXECUTABLE}"
          init
          --quiet
  COMMAND "${GIT_EXECUTABLE}"
          remote add origin
          ../..
  WORKING_DIRECTORY
          "${hooks_directory}"
  COMMENT "Initializing the hooks repository")
add_custom_target(hooks-init
  DEPENDS
    "${hooks_directory}/.git")

add_custom_target(hooks-update ALL
  DEPENDS
    hooks-init)
add_custom_command(
  TARGET  hooks-update
  COMMAND "${GIT_EXECUTABLE}"
          fetch
          --quiet
          origin
          remotes/origin/hooks
  COMMAND "${GIT_EXECUTABLE}"
          merge
          --quiet
          FETCH_HEAD
  WORKING_DIRECTORY
          "${hooks_directory}"
  COMMENT "Updating hooks repository")

Make hook initialization quiet as well

Make hook initialization quiet as well


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

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

include(polly_add_cache_flag)

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

Fix 32-bit gcc builds for assembler too Add -m32 flag for ASM as well as C and C++


# We hardcode the version numbers since we cannot determine versions during
# configure stage.
set (vv_version_major 1)
set (vv_version_minor 0)
set (vv_version_patch 4)
set (vv_version_suffix)
set (vv_version "${vv_version_major}.${vv_version_minor}")

# Enable CPack packaging.
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VeloView")
set(CPACK_PACKAGE_NAME "VeloView")
set(CPACK_PACKAGE_VENDOR "Velodyne Lidar")
set(CPACK_PACKAGE_VERSION_MAJOR ${vv_version_major})
set(CPACK_PACKAGE_VERSION_MINOR ${vv_version_minor})
if (vv_version_suffix)
  set(CPACK_PACKAGE_VERSION_PATCH ${vv_version_patch}-${vv_version_suffix})
else()
  set(CPACK_PACKAGE_VERSION_PATCH ${vv_version_patch})
endif()

set(CPACK_RESOURCE_FILE_LICENSE "${VelodyneViewerSuperBuild_SOURCE_DIR}/LICENSE")

set(CPACK_PACKAGE_FILE_NAME
    "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${package_suffix}")

# We hardcode the version numbers since we cannot determine versions during
# configure stage.
set (vv_version_major 1)
set (vv_version_minor 0)
set (vv_version_patch 5)
set (vv_version_suffix)
set (vv_version "${vv_version_major}.${vv_version_minor}")

# Enable CPack packaging.
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VeloView")
set(CPACK_PACKAGE_NAME "VeloView")
set(CPACK_PACKAGE_VENDOR "Velodyne Lidar")
set(CPACK_PACKAGE_VERSION_MAJOR ${vv_version_major})
set(CPACK_PACKAGE_VERSION_MINOR ${vv_version_minor})
if (vv_version_suffix)
  set(CPACK_PACKAGE_VERSION_PATCH ${vv_version_patch}-${vv_version_suffix})
else()
  set(CPACK_PACKAGE_VERSION_PATCH ${vv_version_patch})
endif()

set(CPACK_RESOURCE_FILE_LICENSE "${VelodyneViewerSuperBuild_SOURCE_DIR}/LICENSE")

set(CPACK_PACKAGE_FILE_NAME
    "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${package_suffix}")

Change version number to 1.0.5

Change version number to 1.0.5


# Sets for the current directory (and below) the testsuite to use.
# This macro should be used with the AddSTPGTest function.
macro(AddGTestSuite TESTSUITENAME)
    set(TESTSUITE "${TESTSUITENAME}") # Unit test group name
    # Setup custom target
    add_custom_target(${TESTSUITE})
    add_dependencies(check ${TESTSUITE})

    if(USE_VALGRIND)
        set(LIT_EXTRA_FLAGS --vg --vg-leak)
    else()
        set(LIT_EXTRA_FLAGS "")
    endif()

    add_custom_command(TARGET ${TESTSUITE}
                       POST_BUILD
                       COMMAND ${LIT_TOOL} ${LIT_ARGS} ${LIT_EXTRA_FLAGS} ${CMAKE_CURRENT_BINARY_DIR}
                       COMMENT "Running ${TESTSUITE}"
                      )

    # Setup lit configuration
    configure_file(${CMAKE_SOURCE_DIR}/tests/lit-unit-tests-common.site.cfg.in
                   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
                   @ONLY@
                  )
endmacro()

# Sets for the current directory (and below) the testsuite to use.
# This macro should be used with the AddSTPGTest function.
macro(AddGTestSuite TESTSUITENAME)
    set(TESTSUITE "${TESTSUITENAME}") # Unit test group name
    # Setup custom target
    add_custom_target(${TESTSUITE})
    add_dependencies(check ${TESTSUITE})

    if(USE_VALGRIND)
        set(LIT_EXTRA_FLAGS --vg --vg-leak)
    else()
        set(LIT_EXTRA_FLAGS "")
    endif()

    add_custom_command(TARGET ${TESTSUITE}
                       POST_BUILD
                       COMMAND ${LIT_TOOL} ${LIT_ARGS} ${LIT_EXTRA_FLAGS} ${CMAKE_CURRENT_BINARY_DIR}
                       COMMENT "Running ${TESTSUITE}"
                      )

    # Setup lit configuration
    configure_file(${CMAKE_SOURCE_DIR}/tests/lit-unit-tests-common.site.cfg.in
                   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
                   @ONLY
                  )
endmacro()

Fix typo that CMake 3 complained about.

Fix typo that CMake 3 complained about.


# Locate the Vulkan SDK
# This module defines
#  Vulkan_FOUND, if false, do not try to link to Lua
#  Vulkan_INCLUDE_DIR
#  Vulkan_LIBRARY
#
# Specifying either Qt5_ROOT_DIR or Qt5_QMAKE_EXECUTABLE is enough
# to find the entire Qt5 install.

FIND_LIBRARY(Vulkan_LIBRARY
  NAMES vulkan-1 vulkan
  PATH_SUFFIXES lib64 lib Bin
  PATHS
    ${VK_SDK_PATH}
    $ENV{VK_SDK_PATH}
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw
    /opt/local
    /opt/csw
    /opt
)
FIND_PATH(Vulkan_INCLUDE_DIR vulkan/vulkan.h
  PATH_SUFFIXES include Include
  PATHS
    ${VK_SDK_PATH}
    $ENV{VK_SDK_PATH}
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw
    /opt/local
    /opt/csw
    /opt
)

SET(Vulkan_LIBRARIES
  ${Vulkan_LIBRARY}
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Vulkan  DEFAULT_MSG  Vulkan_INCLUDE_DIR Vulkan_LIBRARY)

MARK_AS_ADVANCED(Vulkan_INCLUDE_DIR Vulkan_LIBRARY)

# Locate the Vulkan SDK
# This module defines
#  Vulkan_FOUND
#  Vulkan_INCLUDE_DIR
#  Vulkan_LIBRARY
#
# Specifying either Qt5_ROOT_DIR or Qt5_QMAKE_EXECUTABLE is enough
# to find the entire Qt5 install.

FIND_LIBRARY(Vulkan_LIBRARY
  NAMES vulkan-1 vulkan
  PATH_SUFFIXES lib64 lib Bin
  PATHS
    ${VK_SDK_PATH}
    $ENV{VK_SDK_PATH}
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw
    /opt/local
    /opt/csw
    /opt
)
FIND_PATH(Vulkan_INCLUDE_DIR vulkan/vulkan.h
  PATH_SUFFIXES include Include
  PATHS
    ${VK_SDK_PATH}
    $ENV{VK_SDK_PATH}
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw
    /opt/local
    /opt/csw
    /opt
)

SET(Vulkan_LIBRARIES
  ${Vulkan_LIBRARY}
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Vulkan  DEFAULT_MSG  Vulkan_INCLUDE_DIR Vulkan_LIBRARY)

MARK_AS_ADVANCED(Vulkan_INCLUDE_DIR Vulkan_LIBRARY)

Fix a copy-paste error in the header

Fix a copy-paste error in the header


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

ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )

file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
PYTHON_COVERAGE:BOOL=ON
")

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

ctest_start("Nightly")
ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY})

# We must run grunt so the correct git hash gets built into the version file
execute_process(COMMAND grunt WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY})

ctest_configure()
ctest_build()
ctest_test(PARALLEL_LEVEL 3 RETURN_VALUE res)
ctest_coverage()
ctest_submit()

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

ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )

file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
PYTHON_COVERAGE:BOOL=ON
")

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

ctest_start("Nightly")
ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY})

# We must run grunt so the correct git hash gets built into the version file
execute_process(COMMAND npm install WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY})

ctest_configure()
ctest_build()
ctest_test(PARALLEL_LEVEL 3 RETURN_VALUE res)
ctest_coverage()
ctest_submit()

Use "npm install" rather than "grunt" after update step on aiur


FIND_SNAP_SYS_PACKAGE(
  NAME                  SYS-qt4
  LIBRARY_NAMES
  libQt3Support.so  libQt5ScriptTools.so  libQt5V8.so           libQtCLucene.so  libQtDBus.so         libQtDesignerComponents.so  libQtGui.so   libQtNetwork.so  libQtScript.so       libQtSql.so  libQtTest.so         libQtXml.so libQt5Script.so   libQt5Svg.so          libQt5XmlPatterns.so  libQtCore.so     libQtDeclarative.so  libQtDesigner.so            libQtHelp.so  libQtOpenGL.so   libQtScriptTools.so  libQtSvg.so  libQtXmlPatterns.so
  LIBRARY_SEARCH_PATHS  /usr/lib/x86_64-linux-gnu
  PATH_TO_A_HEADER      Qt/qwidget.h
  INCLUDE_SEARCH_PATHS  /usr/include/qt4/
)

FIND_SNAP_SYS_PACKAGE(
  NAME                  SYS-qt4
  LIBRARY_NAMES         libQtCore.so  libQtGui.so   libQtNetwork.so   libQtXml.so
                        #libQt3Support.so  libQtCLucene.so  libQtDBus.so libQtScript.so   libQtSql.so  libQtTest.so libQtDeclarative.so  libQtDesigner.so libQtDesignerComponents.so     libQtHelp.so  libQtOpenGL.so   libQtScriptTools.so  libQtSvg.so  libQtXmlPatterns.so
  LIBRARY_SEARCH_PATHS  /usr/local/lib /usr/lib/x86_64-linux-gnu
  PATH_TO_A_HEADER      Qt/qwidget.h
  INCLUDE_SEARCH_PATHS  /usr/include/qt4/
)

Remove some extra deps that cause build to fail on travis CI.


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

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

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

[clang-fuzzer] Include ExternalProject before using it.

Some versions of CMake require ExternalProject to be included before we
can use ExternalProject_Add.

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


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

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

Increment version to VTK 6.3.0

Increment version to VTK 6.3.0

Change-Id: I618606e72fe6b65dfbeb265d5835270f85ad2711


MACRO(OPENCOG_ADD_ATOM_TYPES SCRIPT_FILE HEADER_FILE DEFINITIONS_FILE INHERITANCE_FILE SCM_FILE PYTHON_FILE)
    ADD_CUSTOM_COMMAND (
        COMMAND "${CMAKE_COMMAND}" -DSCRIPT_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_FILE}\" -DHEADER_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${HEADER_FILE}\" -DDEFINITIONS_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${DEFINITIONS_FILE}\" -DINHERITANCE_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${INHERITANCE_FILE}\" -DSCM_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${SCM_FILE}\" -
         -DPYTHON_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_FILE}\" -P "${CMAKE_SOURCE_DIR}/lib/OpenCogAtomTypes.cmake"
        OUTPUT  "${CMAKE_CURRENT_BINARY_DIR}/${HEADER_FILE}"
                "${CMAKE_CURRENT_BINARY_DIR}/${DEFINITIONS_FILE}"
                "${CMAKE_CURRENT_BINARY_DIR}/${INHERITANCE_FILE}"
                "${CMAKE_CURRENT_BINARY_DIR}/${SCM_FILE}"
                "${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_FILE}"
        DEPENDS "${SCRIPT_FILE}"
        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
        COMMENT "Generating opencog types"
    )
ENDMACRO(OPENCOG_ADD_ATOM_TYPES SCRIPT_FILE HEADER_FILE DEFINITIONS_FILE INHERITANCE_FILE SCM_FILE PYTHON_FILE)

MACRO(OPENCOG_ADD_ATOM_TYPES SCRIPT_FILE HEADER_FILE DEFINITIONS_FILE INHERITANCE_FILE SCM_FILE PYTHON_FILE)
    ADD_CUSTOM_COMMAND (
        COMMAND "${CMAKE_COMMAND}" -DSCRIPT_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_FILE}\" -DHEADER_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${HEADER_FILE}\" -DDEFINITIONS_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${DEFINITIONS_FILE}\" -DINHERITANCE_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${INHERITANCE_FILE}\" -DSCM_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${SCM_FILE}\" -DPYTHON_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_FILE}\" -P "${CMAKE_SOURCE_DIR}/lib/OpenCogAtomTypes.cmake"
        OUTPUT  "${CMAKE_CURRENT_BINARY_DIR}/${HEADER_FILE}"
                "${CMAKE_CURRENT_BINARY_DIR}/${DEFINITIONS_FILE}"
                "${CMAKE_CURRENT_BINARY_DIR}/${INHERITANCE_FILE}"
                "${CMAKE_CURRENT_BINARY_DIR}/${SCM_FILE}"
                "${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_FILE}"
        DEPENDS "${SCRIPT_FILE}"
        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
        COMMENT "Generating opencog types"
    )
ENDMACRO(OPENCOG_ADD_ATOM_TYPES SCRIPT_FILE HEADER_FILE DEFINITIONS_FILE INHERITANCE_FILE SCM_FILE PYTHON_FILE)

Remove spurious "-" in macro

Remove spurious "-" in macro


# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(HigherOrderAccurateGradient
  "This module contains a filter to compute higher order
  accurate numerical derivatives and gradients from an input scalar image.
  field from a displacement field image.
  Higher Order Accurate Derivative and Gradient Calculation in ITK
  http://www.insight-journal.org/browse/publication/775
  http://hdl.handle.net/10380/3231"
  GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKHigherOrderAccurateGradient.git
  GIT_TAG 011136180ec1779a4a6eb2294efd06deefe0fe7a
  )

# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(HigherOrderAccurateGradient
  "This module contains a filter to compute higher order
  accurate numerical derivatives and gradients from an input scalar image.
  field from a displacement field image.
  Higher Order Accurate Derivative and Gradient Calculation in ITK
  http://www.insight-journal.org/browse/publication/775
  http://hdl.handle.net/10380/3231"
  GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKHigherOrderAccurateGradient.git
  GIT_TAG 25e3ff135678fad2492db6aa5aa9fadc26d725e8
  )

STYLE: Update HigherOrderAccurateGradient module for style fixes.

Addresses double underscore header guard KWStyle test failures.

Change-Id: Ibad57ef302b317f25276bd9e7c4b1be566acd72c


cmake_minimum_required (VERSION 3.2)

# Create groups for the test source files, this creates the proper directory structure under the
# Visual Studio filters
macro(create_source_groups _source_files _relative_directory)
	foreach(_file IN ITEMS ${_source_files})
		get_filename_component(_file_path "${_file}" PATH)
		file(RELATIVE_PATH _file_path_rel "${_relative_directory}" "${_file_path}")
		string(REPLACE "/" "\\" _group_path "${_file_path_rel}")
		source_group("${_group_path}" FILES "${_file}")
	endforeach()
endmacro()

cmake_minimum_required (VERSION 3.2)

# Create groups for the test source files, this creates the proper directory structure under the
# Visual Studio filters
macro(create_source_groups _source_files _relative_directory)
	foreach(_file IN ITEMS ${_source_files})
		get_filename_component(_file_path "${_file}" PATH)
		file(RELATIVE_PATH _file_path_rel "${_relative_directory}" "${_file_path}")
		string(REPLACE "/" "\\" _group_path "${_file_path_rel}")
		string(REPLACE "..\\" "" _group_path "${_group_path}")
		source_group("${_group_path}" FILES "${_file}")
	endforeach()
endmacro()

Fix source grouping when '..\' is part of the path.


#
# Create tests for examples
#
if (BUILD_TESTING)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(MyTests "")
foreach(SOURCE_FILE ${ALL_FILES})
  STRING(REPLACE ".cxx" "" TMP ${SOURCE_FILE})
  STRING(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
  SET(MyTests ${MyTests} Test${EXAMPLE}.cxx)
  FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Test${EXAMPLE}.cxx
    "#define main Test${EXAMPLE}\n#include \"${EXAMPLE}.cxx\"\n")
  LIST(FIND NEEDS_ARGS ${EXAMPLE} SKIP_ADD)
  if(SKIP_ADD EQUAL -1)
    ADD_TEST(${KIT}-${EXAMPLE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests Test${EXAMPLE})
  endif(SKIP_ADD EQUAL -1)
  set_property(TEST ${KIT}-${EXAMPLE} PROPERTY LABELS WikiExamples)
endforeach(SOURCE_FILE)
SET(VTK_BINARY_DIR ${WikiExamples_BINARY_DIR})
SET(VTK_DATA_ROOT ${WikiExamples_SOURCE_DIR}/Testing)
INCLUDE(${WikiExamples_SOURCE_DIR}/CMake/vtkTestingObjectFactory.cmake)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
               ${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests ${KIT_LIBS})
endif()

#
# Create tests for examples
#
if (BUILD_TESTING)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(MyTests "")
foreach(SOURCE_FILE ${ALL_FILES})
  STRING(REPLACE ".cxx" "" TMP ${SOURCE_FILE})
  STRING(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
  SET(MyTests ${MyTests} Test${EXAMPLE}.cxx)
  FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Test${EXAMPLE}.cxx
    "#define main Test${EXAMPLE}\n#include \"${EXAMPLE}.cxx\"\n")
  LIST(FIND NEEDS_ARGS ${EXAMPLE} SKIP_ADD)
  if(SKIP_ADD EQUAL -1)
    ADD_TEST(${KIT}-${EXAMPLE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests Test${EXAMPLE})
  endif(SKIP_ADD EQUAL -1)
  set_property(TEST ${KIT}-${EXAMPLE} PROPERTY LABELS WikiExamples)
endforeach(SOURCE_FILE)
SET(VTK_BINARY_DIR ${WikiExamples_BINARY_DIR})
SET(VTK_DATA_ROOT ${WikiExamples_SOURCE_DIR}/src/Testing)
INCLUDE(${WikiExamples_SOURCE_DIR}/CMake/vtkTestingObjectFactory.cmake)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
               ${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests ${KIT_LIBS})
endif()

Set proper location of baselines

ENH: Set proper location of baselines


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

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

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

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

Remove reference to specific SDK include


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

# Include definitions for bfd as a base.
include("${ZEPHYR_BASE}/cmake/linker/ld/linker_flags.cmake")

set_property(TARGET linker PROPERTY coverage --coverage)

zephyr: Fix the coverage property for linker/lld.

Zephyr has a linker config for clang, but we don't use that and instead
have our own linker definition for ld.lld. If you have code coverage
enabled, the --coverage flag is missing from the link step. This fixes
that.

BUG=b:183007888
TEST=Add CONFIG_COVERAGE=y to test/base32/prj.conf and zmake.
BRANCH=none

Signed-off-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Change-Id: Ibb3d420cf92e48507768f916fa4792d5bc90e2d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2765150
Reviewed-by: Simon Glass <c00b0378376498bd9cd974c388df8854c0131d27@chromium.org>


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

IF (NOT OSMESA_INCLUDE_DIR)
  FIND_PATH(OSMESA_INCLUDE_DIR GL/osmesa.h
    /usr/openwin/share/include
    /opt/graphics/OpenGL/include
  )
ENDIF (NOT OSMESA_INCLUDE_DIR)

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

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSMesa  DEFAULT_MSG  OSMESA_LIBRARY  OSMESA_INCLUDE_DIR)

MARK_AS_ADVANCED(OSMESA_INCLUDE_DIR OSMESA_LIBRARY)

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

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

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

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OSMesa  DEFAULT_MSG  OSMESA_LIBRARY  OSMESA_INCLUDE_DIR)

mark_as_advanced(OSMESA_INCLUDE_DIR OSMESA_LIBRARY)

Update to modern CMake style

Update to modern CMake style

Change-Id: I6c64edc053d65fecb7db2d6a39a38c40e7fdf9ef


#
# Find the packages required by this module
#
find_package(VTK REQUIRED)
set(VERSION_MIN "5.9.20110419")
if (${VTK_VERSION} VERSION_LESS ${VERSION_MIN})
  message(ERROR " VtkGlue requires VTK version ${VERSION_MIN} or newer but the current version is ${VTK_VERSION}")
endif()

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

#
# Find the packages required by this module
#

# Needed VTK version
set(VERSION_MIN "5.9.20110419")

# Look for VTK
find_package(VTK REQUIRED)

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

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

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

Add VTK_VERSION for older VTK versions

BUG: Add VTK_VERSION for older VTK versions

For older VTK's, VTK_VERSION is not defined. It needs to be setup manually.

See ITK-3304

Change-Id: I5efec656190e7417c7a2cbfa1b27b8b545261ca0


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

set(DART_TESTING_TIMEOUT "4800")

set(CTEST_PROJECT_NAME "netcdf-c")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")

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

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

set(DART_TESTING_TIMEOUT "4800")

set(CTEST_PROJECT_NAME "netcdf-c")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")

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

Reset the CDashboard location to netcdf-c from netcdf-staging.


add_definitions(
	    --std=c++11

            -Wall
            -Wextra

            -Wno-unknown-pragmas
            -Wno-unused-local-typedefs
            -Wno-unused-variable
        )

if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
    add_definitions(
	-g
	-O0
    )
endif()

if(${CMAKE_BUILD_TYPE} MATCHES "Release")
    add_definitions(
	-O3
    )
endif()

add_definitions(
	    --std=c++11
	    --stdlib=libc++

            -Wall
            -Wextra

            -Wno-unknown-pragmas
            -Wno-unused-local-typedefs
            -Wno-unused-variable
        )

if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
    add_definitions(
	-g
	-O0
    )
endif()

if(${CMAKE_BUILD_TYPE} MATCHES "Release")
    add_definitions(
	-O3
    )
endif()

Use the good c++ runtime.

Use the good c++ runtime.


# Fixes functions for the sprokit project
# The following functions are defined:
#
#   sprokit_use_fixes
#
# Their syntax is:
#
#   sprokit_use_fixes([name ...])
#     Set up future targets to use fixes for Boost used in sprokit.
#     Does not affect parent directories.

set(SPROKIT_FIXES "@sprokit_fixes@"
  CACHE INTERNAL "Fixes available from sprokit")

function (sprokit_use_fixes)
  foreach (fix IN LISTS ARGN)
    foreach (includedir IN LISTS SPROKIT_INCLUDE_DIR)
      include_directories(BEFORE SYSTEM "${includedir}/fixes/${fix}")
    endforeach ()
  endforeach ()
endfunction ()

# Fixes functions for the sprokit project
# The following functions are defined:
#
#   sprokit_use_fixes
#
# Their syntax is:
#
#   sprokit_use_fixes([name ...])
#     Set up future targets to use fixes for Boost used in sprokit.
#     Does not affect parent directories. If called without arguments, all
#     known fixes are used.

define_property(GLOBAL
  PROPERTY   sprokit_fixes
  BRIEF_DOCS "A list of all fixes sprokit provides for various headers."
  FULL_DOCS  "Some things in sprokit require a patched header (usually for "
             "Boost) and as such, requires extra include directories for each "
             "fix. The fixes available depends on whether sprokit was built "
             "using them or not.")
set_property(GLOBAL
  PROPERTY sprokit_fixes
  "@sprokit_fixes@")

function (sprokit_use_fixes)
  if (ARGN)
    set(fixes "${ARGN}")
  else ()
    get_property(fixes GLOBAL
      PROPERTY sprokit_fixes)
  endif ()
  foreach (fix IN LISTS fixes)
    foreach (includedir IN LISTS SPROKIT_INCLUDE_DIR)
      include_directories(BEFORE SYSTEM "${includedir}/fixes/${fix}")
    endforeach ()
  endforeach ()
endfunction ()

Use a global property for available sprokit fixes


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 OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    set_property(TARGET ${name} APPEND_STRING PROPERTY COMPILE_FLAGS " -m32")
    set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS    " -m32")
  endif()

  if(CMAKE_COMPILER_IS_GNUCXX)
    target_compile_options(${name} PRIVATE -Wno-attributes)
  endif()

  if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    target_compile_options(${name} PRIVATE -Wno-ignored-attributes)
  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 version requirement


FIND_PROGRAM(CABAL_EXECUTABLE cabal)

IF (CABAL_EXECUTABLE)
    EXECUTE_PROCESS(
        COMMAND cabal list
        OUTPUT_QUIET
        ERROR_VARIABLE out
    )

    IF(out MATCHES "(.)*'hackage.haskell.org' does not exist(.)*")
        MESSAGE(STATUS "Updating cabal package list...")
        EXECUTE_PROCESS(
            COMMAND cabal update
        )
    ENDIF(out MATCHES "(.)*'hackage.haskell.org' does not exist(.)*")

    SET(CABAL_FOUND TRUE)
ELSE (DEFINED CABAL_EXECUTABLE)
	SET(CABAL_FOUND FALSE)
ENDIF (DEFINED CABAL_EXECUTABLE)

FIND_PROGRAM(CABAL_EXECUTABLE cabal)

IF (CABAL_EXECUTABLE)
    EXECUTE_PROCESS(
        COMMAND cabal list nothing
        OUTPUT_QUIET
        ERROR_VARIABLE out
    )

    IF(out MATCHES "(.)*'hackage.haskell.org' does not exist(.)*")
        MESSAGE(STATUS "Updating cabal package list...")
        EXECUTE_PROCESS(
            COMMAND cabal update
        )
    ENDIF(out MATCHES "(.)*'hackage.haskell.org' does not exist(.)*")

    SET(CABAL_FOUND TRUE)
ELSE (DEFINED CABAL_EXECUTABLE)
	SET(CABAL_FOUND FALSE)
ENDIF (DEFINED CABAL_EXECUTABLE)

Make cabal settings a lot faster

Make cabal settings a lot faster


# Find and set Boost flags

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

if(${CMAKE_VERSION} VERSION_LESS 2.8.5)
  SET(Boost_ADDITIONAL_VERSIONS "1.43" "1.43.0" "1.44" "1.44.0" "1.45" "1.45.0" "1.46.1" "1.46.0" "1.46" "1.47" "1.47.0")
else(${CMAKE_VERSION} VERSION_LESS 2.8.5)
  SET(Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0")
endif(${CMAKE_VERSION} VERSION_LESS 2.8.5)

find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time)

if(Boost_FOUND)
  # Obtain diagnostic information about Boost's automatic linking outputted
  # during compilation time.
  add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})

  include_directories(${Boost_INCLUDE_DIRS})
  link_directories(${Boost_LIBRARY_DIRS})
endif(Boost_FOUND)

# Find and set Boost flags

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

if(${CMAKE_VERSION} VERSION_LESS 2.8.5)
  SET(Boost_ADDITIONAL_VERSIONS "1.43" "1.43.0" "1.44" "1.44.0" "1.45" "1.45.0" "1.46.1" "1.46.0" "1.46" "1.47" "1.47.0")
else(${CMAKE_VERSION} VERSION_LESS 2.8.5)
  SET(Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0")
endif(${CMAKE_VERSION} VERSION_LESS 2.8.5)

find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time iostreams)

if(Boost_FOUND)
  # Obtain diagnostic information about Boost's automatic linking outputted
  # during compilation time.
  add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})

  include_directories(${Boost_INCLUDE_DIRS})
  link_directories(${Boost_LIBRARY_DIRS})
endif(Boost_FOUND)

Add iostreams as required component

Add iostreams as required component

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@1994 a9d63959-f2ad-4865-b262-bf0e56cfafb6


include(sitkSITKLegacyNaming)

#-----------------------------------------------------------------------------
# Forbid downloading resources from the network during a build. This helps
# when building on systems without network connectivity to determine which
# resources much be obtained manually and made available to the build.
option(SimpleITK_FORBID_DOWNLOADS "Do not download source code or data from the network" OFF)
mark_as_advanced(SimpleITK_FORBID_DOWNLOADS)
sitk_legacy_naming(SimpleITK_FORBID_DOWNLOADS)

macro(sitk_enforce_forbid_downloads _name)
  if(SimpleITK_FORBID_DOWNLOADS)
    message(SEND_ERROR "Attempted to download ${_name} when SimpleITK_FORBID_DOWNLOADS is ON")
  endif()
endmacro()

Include CMake legacy module when used

Include CMake legacy module when used

When building the Wrapping directories as standalone modules, this
required include was not available.