[orange-math] new port (#42756)

Co-authored-by: Mengna-Li <543250287@qq.com>
This commit is contained in:
Saikari 2024-12-20 23:21:05 +03:00 committed by GitHub
parent 9790589e0f
commit 4c71f15288
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,34 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO orange-cpp/omath
REF "v${VERSION}"
SHA512 467b1abbdf5b9a7f49ed50824eaa4641f05d6088e84f40320b5c82a1bdbf685cc8d0f0a4f4ab6be49e3a8ed13103ee3e808dde3b556a00742f7b53c519c183e3
HEAD_REF master
)
file(READ "${SOURCE_PATH}/cmake/omathConfig.cmake.in" cmake_config)
file(WRITE "${SOURCE_PATH}/cmake/omathConfig.cmake.in"
"${cmake_config}
check_required_components(omath)
")
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIBS)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DOMATH_BUILD_TESTS=OFF
-DOMATH_THREAT_WARNING_AS_ERROR=OFF
-DOMATH_BUILD_AS_SHARED_LIBRARY=${BUILD_SHARED_LIBS}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/omath" PACKAGE_NAME "omath")
vcpkg_copy_pdbs()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -0,0 +1,18 @@
{
"name": "orange-math",
"version": "1.0.1",
"description": "General purpose math library",
"homepage": "https://github.com/orange-cpp/omath",
"license": "MIT",
"supports": "windows",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,7 @@
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_cmake_configure(
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
)
vcpkg_cmake_build()

View File

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.26)
project(vcpkg-ci-orange-math)
set(CMAKE_CXX_STANDARD 26)
add_executable(main main.cpp)
find_package(omath CONFIG REQUIRED)
target_link_libraries(main PRIVATE omath::omath)

View File

@ -0,0 +1,18 @@
#include <iostream>
#include <omath/Vector2.hpp>
#include <omath/pathfinding/Astar.hpp>
int main()
{
omath::pathfinding::NavigationMesh mesh;
mesh.m_verTextMap[{0.f, 0.f, 0.f}] = { {0.f, 1.f, 0.f} };
mesh.m_verTextMap[{0.f, 1.f, 0.f}] = { {0.f, 2.f, 0.f} };
mesh.m_verTextMap[{0.f, 2.f, 0.f}] = { {0.f, 3.f, 0.f} };
mesh.m_verTextMap[{0.f, 3.f, 0.f}] = {};
omath::Vector2 w = omath::Vector2(20.0, 30.0);
std::cout << w.x << "\t" << w.y << std::endl;
return 0;
}

View File

@ -0,0 +1,13 @@
{
"name": "vcpkg-ci-orange-math",
"version-string": "ci",
"description": "Testing packages which provide orange-math",
"license": null,
"dependencies": [
"orange-math",
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -6580,6 +6580,10 @@
"baseline": "1.5.1",
"port-version": 1
},
"orange-math": {
"baseline": "1.0.1",
"port-version": 0
},
"omniorb": {
"baseline": "4.3.0",
"port-version": 3

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "a0015767dd3fca5dcd70397302311194c88af7e4",
"version": "1.0.1",
"port-version": 0
}
]
}