diff --git a/ports/orange-math/portfile.cmake b/ports/orange-math/portfile.cmake new file mode 100644 index 0000000000..5fa9c76272 --- /dev/null +++ b/ports/orange-math/portfile.cmake @@ -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") diff --git a/ports/orange-math/vcpkg.json b/ports/orange-math/vcpkg.json new file mode 100644 index 0000000000..e2f1164681 --- /dev/null +++ b/ports/orange-math/vcpkg.json @@ -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 + } + ] +} diff --git a/scripts/test_ports/vcpkg-ci-orange-math/portfile.cmake b/scripts/test_ports/vcpkg-ci-orange-math/portfile.cmake new file mode 100644 index 0000000000..62422cac00 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-orange-math/portfile.cmake @@ -0,0 +1,7 @@ +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" +) + +vcpkg_cmake_build() diff --git a/scripts/test_ports/vcpkg-ci-orange-math/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-orange-math/project/CMakeLists.txt new file mode 100644 index 0000000000..b06b6d6568 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-orange-math/project/CMakeLists.txt @@ -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) diff --git a/scripts/test_ports/vcpkg-ci-orange-math/project/main.cpp b/scripts/test_ports/vcpkg-ci-orange-math/project/main.cpp new file mode 100644 index 0000000000..66f936fc00 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-orange-math/project/main.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +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; +} diff --git a/scripts/test_ports/vcpkg-ci-orange-math/vcpkg.json b/scripts/test_ports/vcpkg-ci-orange-math/vcpkg.json new file mode 100644 index 0000000000..dcbdd385f6 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-orange-math/vcpkg.json @@ -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 + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index eeb2e38e80..1467b7f41e 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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 diff --git a/versions/o-/orange-math.json b/versions/o-/orange-math.json new file mode 100644 index 0000000000..782ecb5627 --- /dev/null +++ b/versions/o-/orange-math.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "a0015767dd3fca5dcd70397302311194c88af7e4", + "version": "1.0.1", + "port-version": 0 + } + ] +}