From 99cce5d48c6d548f22b6bf077e618a6f7259f655 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 7 Sep 2022 12:22:47 +0200 Subject: [PATCH] add test for find_package(Protobuf REQUIRED) --- recipe/cmake_test/CMakeLists.txt | 6 ++++++ recipe/meta.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 recipe/cmake_test/CMakeLists.txt diff --git a/recipe/cmake_test/CMakeLists.txt b/recipe/cmake_test/CMakeLists.txt new file mode 100644 index 0000000..8c0f044 --- /dev/null +++ b/recipe/cmake_test/CMakeLists.txt @@ -0,0 +1,6 @@ +project(cf_dummy LANGUAGES C CXX) +cmake_minimum_required(VERSION 3.12) +# CMake seems to prefer its own FindProtobuf to the +# protobuf-config.cmake being distributed by this +# feedstock; make sure things work +find_package(Protobuf REQUIRED) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f41eace..f512d5b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -60,6 +60,13 @@ outputs: run: - ucrt # [win] test: + requires: + # cmake needs compiler to be able to run package detection, see + # https://discourse.cmake.org/t/questions-about-find-package-cli-msvc/6194 + - {{ compiler('cxx') }} # [win] + - cmake # [win] + files: + - cmake_test/ commands: {% for each_lib in libraries %} # shared libraries @@ -85,6 +92,10 @@ outputs: # binary - protoc --help + # more CMake integration (CMake uses its own FindProtobuf) + - cd cmake_test # [win] + - cmake %CMAKE_ARGS% . # [win] + - name: libprotobuf-static script: build-static.sh # [unix] # cmake script currently disabled due to compatibility issues with @@ -105,6 +116,13 @@ outputs: run_constrained: - libprotobuf <0a0 # [win] test: + requires: + # cmake needs compiler to be able to run package detection, see + # https://discourse.cmake.org/t/questions-about-find-package-cli-msvc/6194 + - {{ compiler('cxx') }} # [win] + - cmake # [win] + files: + - cmake_test/ commands: {% for each_lib in libraries %} # static libraries @@ -117,6 +135,13 @@ outputs: # binary - protoc --help # [win] + # cmake + - if not exist %LIBRARY_LIB%\cmake\protobuf\protobuf-config.cmake exit 1 # [win] + + # more CMake integration (CMake uses its own FindProtobuf) + - cd cmake_test # [win] + - cmake %CMAKE_ARGS% . # [win] + about: home: https://developers.google.com/protocol-buffers/ license: BSD-3-Clause