Skip to content

Commit

Permalink
[glibmm] update test packages
Browse files Browse the repository at this point in the history
  • Loading branch information
planetmarshall committed Jan 5, 2023
1 parent c463312 commit e683952
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
4 changes: 0 additions & 4 deletions recipes/glibmm/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ sources:
patches:
"2.72.1":
- patch_file: "patches/enable_static_libs_2_72_1.patch"
base_path: "source_subfolder"
- patch_file: "patches/fix_initialization_order_fiasco_2_72_1.patch"
base_path: "source_subfolder"
"2.66.4":
- patch_file: "patches/enable_static_libs_2_66_4.patch"
base_path: "source_subfolder"
- patch_file: "patches/fix_initialization_order_fiasco_2_66_4.patch"
base_path: "source_subfolder"
5 changes: 1 addition & 4 deletions recipes/glibmm/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ class GlibmmConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}

generators = "pkg_config"
exports_sources = "patches/**"
short_paths = True

@property
Expand Down Expand Up @@ -100,7 +97,7 @@ def generate(self):
"build-examples": "false",
"build-documentation": "false",
"msvc14x-parallel-installable": "false",
"default_library": "shared" if self.options.shared else "static",
"default_library": "shared" if self.options.shared else "static"
})
tc.generate()

Expand Down
7 changes: 2 additions & 5 deletions recipes/glibmm/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
cmake_minimum_required(VERSION 3.6)
project(test_package)

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

find_package(glibmm REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)

if (TARGET glibmm::glibmm-2.68)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
target_link_libraries(${PROJECT_NAME} glibmm::glibmm-2.68 glibmm::giomm-2.68)
target_link_libraries(${PROJECT_NAME} PRIVATE glibmm::glibmm-2.68 glibmm::giomm-2.68)
else()
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME} glibmm::glibmm-2.4 glibmm::giomm-2.4)
target_link_libraries(${PROJECT_NAME} PRIVATE glibmm::glibmm-2.4 glibmm::giomm-2.4)
endif()

21 changes: 16 additions & 5 deletions recipes/glibmm/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake
from conan.tools.layout import cmake_layout

import os


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)

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)
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")

0 comments on commit e683952

Please sign in to comment.