[DO-971] ffmpeg recipe with requirements (!9)
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/9
This commit is contained in:
7
recipes/xorg/all/test_package/CMakeLists.txt
Normal file
7
recipes/xorg/all/test_package/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
project(test_package LANGUAGES C)
|
||||
|
||||
find_package(xorg REQUIRED CONFIG)
|
||||
|
||||
add_executable(test_package test_package.c)
|
||||
target_link_libraries(test_package PRIVATE xorg::xorg)
|
||||
34
recipes/xorg/all/test_package/conanfile.py
Normal file
34
recipes/xorg/all/test_package/conanfile.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import cross_building
|
||||
from conan.tools.cmake import CMake, cmake_layout
|
||||
from conan.tools.gnu import PkgConfigDeps
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv"
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
def generate(self):
|
||||
pkg_config_deps = PkgConfigDeps(self)
|
||||
pkg_config_deps.generate()
|
||||
pkg_config = self.conf_info.get("tools.gnu:pkg_config", default="pkg-config")
|
||||
uuid_pkg_config_file = os.path.join(self.generators_folder, "uuid.pc")
|
||||
self.run(f"{pkg_config} --validate {uuid_pkg_config_file}")
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def test(self):
|
||||
if not cross_building(self):
|
||||
cmd = os.path.join(self.cpp.build.bindirs[0], "test_package")
|
||||
self.run(cmd, env="conanrun")
|
||||
26
recipes/xorg/all/test_package/test_package.c
Normal file
26
recipes/xorg/all/test_package/test_package.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include <X11/Xauth.h>
|
||||
|
||||
#include <X11/SM/SMlib.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
Display *display = XOpenDisplay(NULL);
|
||||
|
||||
if (!display) {
|
||||
printf("XOpenDisplay failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
{
|
||||
char *xau_file_name = XauFileName();
|
||||
if (xau_file_name)
|
||||
printf("XauFileName: %s\n", xau_file_name);
|
||||
}
|
||||
|
||||
XCloseDisplay(display);
|
||||
SmcSetErrorHandler(NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user