Skip to content

Commit

Permalink
fix test_packages
Browse files Browse the repository at this point in the history
  • Loading branch information
xakod committed Feb 16, 2023
1 parent a7a422c commit 7ce174c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
8 changes: 2 additions & 6 deletions recipes/krb5/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
cmake_minimum_required(VERSION 3.1)
project(test_package C)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

include(FindPkgConfig)
pkg_check_modules(Krb5 REQUIRED krb5 IMPORTED_TARGET)
find_package(krb5 REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.c)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::Krb5)
target_link_libraries(${PROJECT_NAME} PRIVATE krb5::krb5)
8 changes: 8 additions & 0 deletions recipes/krb5/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package C)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)
17 changes: 17 additions & 0 deletions recipes/krb5/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from conans import ConanFile, CMake, tools
import os


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)

0 comments on commit 7ce174c

Please sign in to comment.