early-access version 2853
This commit is contained in:
55
externals/vcpkg/ports/loguru/CMakeLists.txt
vendored
Executable file
55
externals/vcpkg/ports/loguru/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(loguru CXX)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
option(INSTALL_HEADERS "Install header files" ON)
|
||||
option(BUILD_WITH_FMT "Build with fmt support" OFF)
|
||||
|
||||
set(loguru_headers
|
||||
loguru.hpp
|
||||
)
|
||||
set(loguru_sources
|
||||
loguru.cpp
|
||||
)
|
||||
|
||||
add_library(loguru ${loguru_sources})
|
||||
target_include_directories(loguru PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:include/loguru>)
|
||||
|
||||
if(BUILD_WITH_FMT)
|
||||
target_compile_definitions(loguru PRIVATE LOGURU_USE_FMTLIB=1)
|
||||
find_package(fmt CONFIG REQUIRED)
|
||||
target_link_libraries(loguru PUBLIC fmt::fmt)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(loguru PUBLIC Threads::Threads ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
set(LOGURU_INCLUDE_INSTALL_DIR include/loguru CACHE PATH "Install directory for headers")
|
||||
if(INSTALL_HEADERS)
|
||||
install(FILES ${loguru_headers} DESTINATION ${LOGURU_INCLUDE_INSTALL_DIR})
|
||||
endif()
|
||||
|
||||
set(INCLUDE_INSTALL_DIR ${LOGURU_INCLUDE_INSTALL_DIR})
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(loguruConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/loguruConfig.cmake
|
||||
INSTALL_DESTINATION share/loguru
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
||||
PATH_VARS INCLUDE_INSTALL_DIR)
|
||||
|
||||
install(TARGETS loguru
|
||||
EXPORT loguruTargets
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/loguruConfig.cmake DESTINATION share/loguru)
|
||||
install(EXPORT loguruTargets DESTINATION share/loguru)
|
||||
3
externals/vcpkg/ports/loguru/copyright
vendored
Executable file
3
externals/vcpkg/ports/loguru/copyright
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
This software is in the public domain. Where that dedication is not recognized, you are granted a perpetual, irrevocable license to copy, modify and distribute it as you see fit.
|
||||
|
||||
That being said, I would appreciate credit! If you find Loguru useful, tweet me at @ernerfeldt mail me at emil.ernerfeldt@gmail.com.
|
||||
9
externals/vcpkg/ports/loguru/loguruConfig.cmake.in
vendored
Executable file
9
externals/vcpkg/ports/loguru/loguruConfig.cmake.in
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
if(UNIX)
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Threads)
|
||||
endif()
|
||||
|
||||
set_and_check(loguru_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/loguruTargets.cmake")
|
||||
37
externals/vcpkg/ports/loguru/portfile.cmake
vendored
Executable file
37
externals/vcpkg/ports/loguru/portfile.cmake
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO emilk/loguru
|
||||
REF 9c2fea0d4530657f23259be4132f8101c98b579e #v2.1.0
|
||||
SHA512 49eebf8648f9d29273af76dca0a4e49155daa3664e98979df005e64eb0fa9f4eeb4228245327d469772c51076571acbe39a644eba531444d8676d9709a7e3914
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
file(INSTALL ${SOURCE_PATH}/loguru.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/loguru)
|
||||
file(INSTALL ${SOURCE_PATH}/loguru.cpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/loguru)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/loguruConfig.cmake.in ${SOURCE_PATH}/loguruConfig.cmake.in COPYONLY)
|
||||
|
||||
vcpkg_check_features(
|
||||
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
fmt BUILD_WITH_FMT
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS_DEBUG
|
||||
-DINSTALL_HEADERS=OFF
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup()
|
||||
vcpkg_copy_pdbs()
|
||||
endif()
|
||||
|
||||
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
25
externals/vcpkg/ports/loguru/vcpkg.json
vendored
Executable file
25
externals/vcpkg/ports/loguru/vcpkg.json
vendored
Executable file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "loguru",
|
||||
"version": "2.1.0",
|
||||
"port-version": 3,
|
||||
"description": "A lightweight and flexible C++ logging library",
|
||||
"homepage": "https://github.com/emilk/loguru",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"fmt": {
|
||||
"description": "Build with fmt support in non-header-only mode",
|
||||
"dependencies": [
|
||||
"fmt"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user