Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freetype: add package_type + fix check of custom CMake variables in test package #16456

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions recipes/freetype/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -37,7 +37,7 @@ class FreetypeConan(ConanFile):
"with_zlib": True,
"with_bzip2": True,
"with_brotli": True,
"subpixel": False
"subpixel": False,
}

@property
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion recipes/freetype/all/test_package_module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down