From abd8fd528675b7fc057bcc312bab1699b6a6250f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 8 Mar 2023 13:05:31 +0100 Subject: [PATCH 1/3] add package_type --- recipes/freetype/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index d7628440e1cc7..400e2661b1c5f 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -19,7 +19,7 @@ class FreetypeConan(ConanFile): homepage = "https://www.freetype.org" license = "FTL" topics = ("freetype", "fonts") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -37,7 +37,7 @@ class FreetypeConan(ConanFile): "with_zlib": True, "with_bzip2": True, "with_brotli": True, - "subpixel": False + "subpixel": False, } @property From 53bee049f560f6feebf5ce5931e6af476bcf7eec Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 8 Mar 2023 13:06:00 +0100 Subject: [PATCH 2/3] fix test of custom CMake variables --- recipes/freetype/all/test_package_module/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/freetype/all/test_package_module/CMakeLists.txt b/recipes/freetype/all/test_package_module/CMakeLists.txt index 3a9f9ffa7c630..2c27f3b8d69b0 100644 --- a/recipes/freetype/all/test_package_module/CMakeLists.txt +++ b/recipes/freetype/all/test_package_module/CMakeLists.txt @@ -15,7 +15,7 @@ set(_custom_vars FREETYPE_VERSION_STRING ) foreach(_custom_var ${_custom_vars}) - if(DEFINED _custom_var) + if(DEFINED ${_custom_var}) message(STATUS "${_custom_var}: ${${_custom_var}}") else() message(FATAL_ERROR "${_custom_var} not defined") From 4f43acacf3145cc82f2047f9b1bc9f5536fc5fcd Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 8 Mar 2023 15:32:08 +0100 Subject: [PATCH 3/3] robust definition of FREETYPE_VERSION_STRING --- recipes/freetype/all/conanfile.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index 400e2661b1c5f..1cf113a1d3cc6 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -203,17 +203,15 @@ def package(self): ) def _create_cmake_module_variables(self, module_file): - content = textwrap.dedent("""\ + content = textwrap.dedent(f"""\ set(FREETYPE_FOUND TRUE) if(DEFINED Freetype_INCLUDE_DIRS) - set(FREETYPE_INCLUDE_DIRS ${Freetype_INCLUDE_DIRS}) + set(FREETYPE_INCLUDE_DIRS ${{Freetype_INCLUDE_DIRS}}) endif() if(DEFINED Freetype_LIBRARIES) - set(FREETYPE_LIBRARIES ${Freetype_LIBRARIES}) - endif() - if(DEFINED Freetype_VERSION) - set(FREETYPE_VERSION_STRING ${Freetype_VERSION}) + set(FREETYPE_LIBRARIES ${{Freetype_LIBRARIES}}) endif() + set(FREETYPE_VERSION_STRING "{self.version}") """) save(self, module_file, content)