Skip to content

Commit 4c71f15

Browse files
luadebugMengna-Li
andauthored
[orange-math] new port (microsoft#42756)
Co-authored-by: Mengna-Li <[email protected]>
1 parent 9790589 commit 4c71f15

File tree

8 files changed

+113
-0
lines changed

8 files changed

+113
-0
lines changed

ports/orange-math/portfile.cmake

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
vcpkg_from_github(
2+
OUT_SOURCE_PATH SOURCE_PATH
3+
REPO orange-cpp/omath
4+
REF "v${VERSION}"
5+
SHA512 467b1abbdf5b9a7f49ed50824eaa4641f05d6088e84f40320b5c82a1bdbf685cc8d0f0a4f4ab6be49e3a8ed13103ee3e808dde3b556a00742f7b53c519c183e3
6+
HEAD_REF master
7+
)
8+
9+
file(READ "${SOURCE_PATH}/cmake/omathConfig.cmake.in" cmake_config)
10+
11+
file(WRITE "${SOURCE_PATH}/cmake/omathConfig.cmake.in"
12+
"${cmake_config}
13+
check_required_components(omath)
14+
")
15+
16+
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIBS)
17+
18+
vcpkg_cmake_configure(
19+
SOURCE_PATH "${SOURCE_PATH}"
20+
OPTIONS
21+
-DOMATH_BUILD_TESTS=OFF
22+
-DOMATH_THREAT_WARNING_AS_ERROR=OFF
23+
-DOMATH_BUILD_AS_SHARED_LIBRARY=${BUILD_SHARED_LIBS}
24+
)
25+
26+
vcpkg_cmake_install()
27+
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/omath" PACKAGE_NAME "omath")
28+
vcpkg_copy_pdbs()
29+
30+
file(REMOVE_RECURSE
31+
"${CURRENT_PACKAGES_DIR}/debug/include"
32+
)
33+
34+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

ports/orange-math/vcpkg.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "orange-math",
3+
"version": "1.0.1",
4+
"description": "General purpose math library",
5+
"homepage": "https://github.com/orange-cpp/omath",
6+
"license": "MIT",
7+
"supports": "windows",
8+
"dependencies": [
9+
{
10+
"name": "vcpkg-cmake",
11+
"host": true
12+
},
13+
{
14+
"name": "vcpkg-cmake-config",
15+
"host": true
16+
}
17+
]
18+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
2+
3+
vcpkg_cmake_configure(
4+
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
5+
)
6+
7+
vcpkg_cmake_build()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cmake_minimum_required(VERSION 3.26)
2+
3+
project(vcpkg-ci-orange-math)
4+
5+
set(CMAKE_CXX_STANDARD 26)
6+
7+
add_executable(main main.cpp)
8+
9+
find_package(omath CONFIG REQUIRED)
10+
target_link_libraries(main PRIVATE omath::omath)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <iostream>
2+
#include <omath/Vector2.hpp>
3+
#include <omath/pathfinding/Astar.hpp>
4+
5+
int main()
6+
{
7+
omath::pathfinding::NavigationMesh mesh;
8+
9+
mesh.m_verTextMap[{0.f, 0.f, 0.f}] = { {0.f, 1.f, 0.f} };
10+
mesh.m_verTextMap[{0.f, 1.f, 0.f}] = { {0.f, 2.f, 0.f} };
11+
mesh.m_verTextMap[{0.f, 2.f, 0.f}] = { {0.f, 3.f, 0.f} };
12+
mesh.m_verTextMap[{0.f, 3.f, 0.f}] = {};
13+
14+
omath::Vector2 w = omath::Vector2(20.0, 30.0);
15+
std::cout << w.x << "\t" << w.y << std::endl;
16+
17+
return 0;
18+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "vcpkg-ci-orange-math",
3+
"version-string": "ci",
4+
"description": "Testing packages which provide orange-math",
5+
"license": null,
6+
"dependencies": [
7+
"orange-math",
8+
{
9+
"name": "vcpkg-cmake",
10+
"host": true
11+
}
12+
]
13+
}

versions/baseline.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6580,6 +6580,10 @@
65806580
"baseline": "1.5.1",
65816581
"port-version": 1
65826582
},
6583+
"orange-math": {
6584+
"baseline": "1.0.1",
6585+
"port-version": 0
6586+
},
65836587
"omniorb": {
65846588
"baseline": "4.3.0",
65856589
"port-version": 3

versions/o-/orange-math.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"versions": [
3+
{
4+
"git-tree": "a0015767dd3fca5dcd70397302311194c88af7e4",
5+
"version": "1.0.1",
6+
"port-version": 0
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)