-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
更新子项目引用,删除不再使用的依赖,优化头文件包含,重构 CMake 配置,改进代码结构和异常处理
- Loading branch information
Showing
55 changed files
with
1,014 additions
and
1,253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# FindLibGit2.cmake | ||
# This module looks for the libgit2 library and sets the following variables: | ||
# LIBGIT2_FOUND - True if libgit2 was found | ||
# LIBGIT2_INCLUDE_DIRS - Directories containing libgit2 headers | ||
# LIBGIT2_LIBRARIES - Libraries to link against libgit2 | ||
# LIBGIT2_VERSION - Version of libgit2 found | ||
|
||
# Use pkg-config if available (usually on Linux and macOS) | ||
find_package(PkgConfig QUIET) | ||
if(PkgConfig_FOUND) | ||
pkg_check_modules(PC_LIBGIT2 libgit2) | ||
endif() | ||
|
||
# Try to find libgit2 using the CMake find_path/find_library functions | ||
find_path(LIBGIT2_INCLUDE_DIR | ||
NAMES git2.h | ||
PATHS ${PC_LIBGIT2_INCLUDEDIR} ${PC_LIBGIT2_INCLUDE_DIRS} ENV INCLUDE | ||
PATH_SUFFIXES libgit2 | ||
) | ||
|
||
find_library(LIBGIT2_LIBRARY | ||
NAMES git2 | ||
PATHS ${PC_LIBGIT2_LIBDIR} ${PC_LIBGIT2_LIBRARY_DIRS} ENV LIB | ||
) | ||
|
||
# Check if both the include path and library were found | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LibGit2 REQUIRED_VARS LIBGIT2_LIBRARY LIBGIT2_INCLUDE_DIR | ||
VERSION_VAR PC_LIBGIT2_VERSION) | ||
|
||
# Set output variables | ||
if(LIBGIT2_FOUND) | ||
set(LIBGIT2_INCLUDE_DIRS ${LIBGIT2_INCLUDE_DIR}) | ||
set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARY}) | ||
|
||
# Try to extract the version if not provided by pkg-config | ||
if(NOT LIBGIT2_VERSION AND EXISTS "${LIBGIT2_INCLUDE_DIR}/git2/version.h") | ||
file(READ "${LIBGIT2_INCLUDE_DIR}/git2/version.h" _version_header) | ||
string(REGEX MATCHALL "#define[ \t]+LIBGIT2_VER_[A-Z]+[ \t]+([0-9]+)" _version_matches ${_version_header}) | ||
list(GET _version_matches 0 _major_match) | ||
list(GET _version_matches 1 _minor_match) | ||
list(GET _version_matches 2 _patch_match) | ||
string(REGEX REPLACE ".*([0-9]+).*" "\\1" LIBGIT2_VERSION_MAJOR ${_major_match}) | ||
string(REGEX REPLACE ".*([0-9]+).*" "\\1" LIBGIT2_VERSION_MINOR ${_minor_match}) | ||
string(REGEX REPLACE ".*([0-9]+).*" "\\1" LIBGIT2_VERSION_PATCH ${_patch_match}) | ||
set(LIBGIT2_VERSION "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${LIBGIT2_VERSION_PATCH}") | ||
endif() | ||
|
||
message(STATUS "Found libgit2: ${LIBGIT2_LIBRARY} (include: ${LIBGIT2_INCLUDE_DIR}, version: ${LIBGIT2_VERSION})") | ||
else() | ||
message(STATUS "Could not find libgit2") | ||
endif() | ||
|
||
# Provide variables for consumers of this module | ||
mark_as_advanced(LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
[requires] | ||
cfitsio/4.3.1 | ||
cpython/3.12.2 | ||
opencv/4.9.0 | ||
openssl/3.2.1 | ||
pybind11/2.12.0 | ||
tinyxml2/10.0.0 | ||
|
Submodule libs
updated
40 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* _component.cpp | ||
* | ||
* Copyright (C) 2023-2024 Max Qian | ||
*/ | ||
|
||
/************************************************* | ||
Date: 2024-05-26 | ||
Description: Some useful tools written in c++ | ||
**************************************************/ | ||
|
||
#include "atom/components/component.hpp" | ||
#include "atom/components/registry.hpp" | ||
|
||
#include "atom/log/loguru.hpp" | ||
|
||
#include "csv2json.hpp" | ||
#include "ini2json.hpp" | ||
#include "json2csv.hpp" | ||
#include "json2ini.hpp" | ||
#include "json2xml.hpp" | ||
#include "json2yaml.hpp" | ||
#include "pci_generator.hpp" | ||
#include "xml2json.hpp" | ||
#include "yaml2json.hpp" | ||
|
||
using namespace lithium::cxxtools::detail; | ||
using namespace lithium::cxxtools::converters; | ||
|
||
ATOM_MODULE(lithium_image, [](Component& com) { | ||
LOG_F(INFO, "Lithium Image Component Constructed"); | ||
|
||
com.def("csv2json", &Csv2Json::convert, "utils", | ||
"Convert a CSV file to JSON format"); | ||
com.def("json2csv", &JsonToCsvConverter::convert, "utils", | ||
"Convert a JSON file to CSV format"); | ||
com.def("ini2json", &Ini2Json::convert, "utils", | ||
"Convert an INI file to JSON format"); | ||
com.def("json2ini", &JsonToIniConverter::convert, "utils", | ||
"Convert a JSON file to INI format"); | ||
com.def("json2xml", &JsonToXmlConverter::convert, "utils", | ||
"Convert a JSON file to XML format"); | ||
com.def("xml2json", &Xml2Json::convert, "utils", | ||
"Convert an XML file to JSON format"); | ||
com.def("yaml2json", &Yaml2Json::convert, "utils", | ||
"Convert a YAML file to JSON format"); | ||
com.def("json2yaml", &JsonToYamlConverter::convert, "utils", | ||
|
||
"Convert a JSON file to YAML format"); | ||
|
||
com.def("generate_pci", &parseAndGeneratePCIInfo, "utils", | ||
"Generate PCI device ID"); | ||
}); |
Oops, something went wrong.