diff options
Diffstat (limited to 'vcpkg/scripts/test_ports/vcpkg-ci-plplot')
4 files changed, 87 insertions, 0 deletions
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-plplot/portfile.cmake b/vcpkg/scripts/test_ports/vcpkg-ci-plplot/portfile.cmake new file mode 100644 index 0000000..69f16ae --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-plplot/portfile.cmake @@ -0,0 +1,11 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" + OPTIONS + ${options} + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" +) +vcpkg_cmake_build() diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-plplot/project/CMakeLists.txt b/vcpkg/scripts/test_ports/vcpkg-ci-plplot/project/CMakeLists.txt new file mode 100644 index 0000000..e77cc8f --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-plplot/project/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.30) +project(plplot-test C CXX) + +find_package(plplot CONFIG REQUIRED) + +add_executable(main main.c) +target_link_libraries(main PRIVATE + PLPLOT::plplot +) +target_compile_definitions(main PRIVATE USING_CMAKE) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(plplot_pc plplot REQUIRED IMPORTED_TARGET) + +add_executable(main-pkconfig main.c) +target_link_libraries(main-pkconfig PRIVATE + PkgConfig::plplot_pc +) diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-plplot/project/main.c b/vcpkg/scripts/test_ports/vcpkg-ci-plplot/project/main.c new file mode 100644 index 0000000..b2d4cd8 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-plplot/project/main.c @@ -0,0 +1,24 @@ + +#ifdef USING_CMAKE +#include <plplot/plplot.h> +#else +#include <plplot.h> +#endif + +int main() +{ + PLFLT x[5], y[5]; + for (int i = 0; i < 5; i++) + { + x[i] = 0.25 * (PLFLT)(i); + y[i] = 2.0 * x[i]; + } + + plinit(); + plenv(0.0, 1.0, 0.0, 2.0, 0, 0); + pllab("x", "y", "2D line plot"); + plline(5, x, y); + plend(); + + return 0; +} diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-plplot/vcpkg.json b/vcpkg/scripts/test_ports/vcpkg-ci-plplot/vcpkg.json new file mode 100644 index 0000000..e4e41f0 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-plplot/vcpkg.json @@ -0,0 +1,34 @@ +{ + "name": "vcpkg-ci-plplot", + "version-string": "ci", + "description": "Port to force features of plplot within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + { + "name": "plplot", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + } + ], + "default-features": [ + "all" + ], + "features": { + "all": { + "description": "Test all features", + "dependencies": [ + { + "name": "plplot", + "features": [ + "wxwidgets" + ], + "platform": "!android" + } + ] + } + } +} |