Commit e12d5450 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

third-party: add loguru

parent 16f4a5e7
find_path(loguru_INCLUDE_DIR
NAMES
loguru.hpp
DOC "loguru include directory")
mark_as_advanced(loguru_INCLUDE_DIR)
find_library(loguru_LIBRARY
NAMES
loguru
DOC "loguru library")
mark_as_advanced(loguru_LIBRARY)
# TODO: extract version from `loguru.hpp`
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(loguru
REQUIRED_VARS loguru_LIBRARY loguru_INCLUDE_DIR)
if (loguru_FOUND)
set(loguru_INCLUDE_DIRS "${loguru_INCLUDE_DIR}")
set(loguru_LIBRARIES "${loguru_LIBRARY}")
if (NOT TARGETS loguru::loguru)
add_library(loguru::loguru UNKNOWN IMPORTED)
set_target_properties(loguru::loguru PROPERTIES
IMPORTED_LOCATION "${loguru_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${loguru_INCLUDE_DIR}")
endif ()
endif ()
vtk_module_third_party(
INTERNAL
LICENSE_FILES "vtkloguru/LICENSE"
VERSION "2.0"
STANDARD_INCLUDE_DIRS
EXTERNAL
PACKAGE loguru
TARGETS loguru::loguru
STANDARD_INCLUDE_DIRS)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/vtk_loguru.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/vtk_loguru.h")
vtk_module_install_headers(
FILES "${CMAKE_CURRENT_BINARY_DIR}/vtk_loguru.h")
#!/usr/bin/env bash
set -e
set -x
shopt -s dotglob
readonly name="loguru"
readonly ownership="loguru Upstream <kwrobot@kitware.com>"
readonly subtree="ThirdParty/$name/vtk$name"
readonly repo="https://gitlab.kitware.com/third-party/loguru.git"
readonly tag="for/vtk"
readonly paths="
CMakeLists.vtk.txt
.gitattributes
LICENSE
loguru.cpp
loguru.hpp
README.kitware.md
README.md
"
extract_source () {
git_archive
pushd "$extractdir/$name-reduced"
mv -v CMakeLists.vtk.txt CMakeLists.txt
popd
}
. "${BASH_SOURCE%/*}/../update-common.sh"
NAME
VTK::loguru
LIBRARY_NAME
vtkloguru
THIRD_PARTY
/*=========================================================================
Program: Visualization Toolkit
Module: vtk_loguru.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef vtk_loguru_h
#define vtk_loguru_h
/* Use the loguru library configured for VTK. */
#cmakedefine01 VTK_MODULE_USE_EXTERNAL_vtkloguru
#if VTK_MODULE_USE_EXTERNAL_vtkloguru
# include <loguru.hpp>
#else
#include <vtkloguru/loguru.hpp>
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment