Skip to content

Commit

Permalink
add test for find_package(Protobuf REQUIRED)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Sep 7, 2022
1 parent 8c36f82 commit a0e6aa2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipe/cmake_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
25 changes: 25 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a0e6aa2

Please sign in to comment.