Skip to content

Commit

Permalink
add CMake integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed May 24, 2023
1 parent 22f8ef4 commit eab5a3c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recipe/cmake_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
project(cf_dummy LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.12)
# make sure package is found
find_package(Thrift REQUIRED)
13 changes: 13 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ outputs:
- openssl
- zlib
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') }}
- cmake
- ninja
files:
- cmake_test/
commands:
# presence of shared libs
- test -f $PREFIX/lib/libthrift.so # [linux]
Expand All @@ -65,6 +73,11 @@ outputs:
- test -f $PREFIX/include/thrift/Thrift.h # [unix]
- if not exist %LIBRARY_INC%\thrift\Thrift.h exit 1 # [win]

# test CMake integration, i.e. find_package(thrift)
- cd cmake_test
- cmake -GNinja $CMAKE_ARGS . # [unix]
- cmake -GNinja %CMAKE_ARGS% . # [win]

- name: thrift-compiler
script: install.sh # [unix]
script: install.bat # [win]
Expand Down

0 comments on commit eab5a3c

Please sign in to comment.