diff --git a/recipes/qscintilla/all/CMakeLists.txt b/recipes/qscintilla/all/CMakeLists.txt index c8e303b6b1891..9cc2657c4dc08 100644 --- a/recipes/qscintilla/all/CMakeLists.txt +++ b/recipes/qscintilla/all/CMakeLists.txt @@ -3,13 +3,8 @@ cmake_minimum_required(VERSION 3.15) project(QScintilla LANGUAGES CXX) option(QSCINTILLA_BUILD_DESIGNER_PLUGIN "Build the QScintilla designer plugin" OFF) - -if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) - set(CMAKE_POSITION_INDEPENDENT_CODE ON) -endif() -if(NOT DEFINED CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 11) -endif() +option(CMAKE_POSITION_INDEPENDENT_CODE "Generate position-independent code" ON) +option(CMAKE_CXX_STANDARD "C++ standard to use" 11) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED) diff --git a/recipes/qscintilla/all/conanfile.py b/recipes/qscintilla/all/conanfile.py index 250a75c174b52..2a2996f415a30 100644 --- a/recipes/qscintilla/all/conanfile.py +++ b/recipes/qscintilla/all/conanfile.py @@ -3,11 +3,11 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os -from conan.tools.build import check_min_cppstd, can_run +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get -required_conan_version = ">=2.0.5" +required_conan_version = ">=2.0.9" class QScintillaConan(ConanFile): @@ -27,25 +27,17 @@ class QScintillaConan(ConanFile): "shared": False, "fPIC": True, } + implements = ["auto_shared_fpic"] def export_sources(self): export_conandata_patches(self) copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - self.options["qt"].widgets = True - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/[>=6.7.1 <7]", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("qt/[>=6.7.1 <7]", transitive_headers=True, transitive_libs=True) def validate(self): check_min_cppstd(self, 11) @@ -53,11 +45,12 @@ def validate(self): raise ConanInvalidConfiguration("QScintilla requires -o qt/*:widgets=True") def build_requirements(self): - if not can_run(self): - self.tool_requires("qt/") + self.tool_requires("cmake/[>=3.27 <4]") + self.tool_requires("qt/") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) @@ -67,7 +60,6 @@ def generate(self): deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/qscintilla/all/test_package/conanfile.py b/recipes/qscintilla/all/test_package/conanfile.py index 3a91c9439218e..2e77b4246fa81 100644 --- a/recipes/qscintilla/all/test_package/conanfile.py +++ b/recipes/qscintilla/all/test_package/conanfile.py @@ -6,8 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" - test_type = "explicit" + generators = "CMakeDeps", "CMakeToolchain" def layout(self): cmake_layout(self)