>From e427681d95d99701ef67c65ea0216eaeef30e807 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler
Date: Sun, 8 Apr 2018 01:33:44 +0100 Subject: [PATCH 3/3] CMakeLists.txt: Raise minimum version to 2.8.12 The first version to support the C_VISIBILITY_HIDDEN property. Necessary for a shared object that only exports explicitly marked APIs. CMake >= 3.3 will also allow to set the property on static builds. Minor clean-up of target_link_libraries() as 2.8.12 allows PRIVATE. Minor clean-up of target_include_directories() as 2.8.12 allows the INSTALL_INTERFACE generator expression. --- CMakeLists.txt | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1503551a9..0470168e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,14 +79,16 @@ # (this is compatible with the same CMake variables in zlib's CMake # support). -# FreeType is build as part of the Python binding freetype-py. Python -# extensions for Linux are usually compiled against the manylinux1 target (PEP -# 513); the Manylinux1 Docker container provided by PyPa happens to contain a -# CentOS 5.11 with cmake 2.8.11.2 installed. Raising the minimum version makes -# sure this requirement is actually tested. -cmake_minimum_required(VERSION 2.8.11.2) -# Allow symbol visibility settings also on static libraries. -cmake_policy(SET CMP0063 NEW) +# FreeType explicitly marks the API to be exported and relies on the compiler +# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property +# starting with 2.8.12. +cmake_minimum_required(VERSION 2.8.12) + +if (NOT CMAKE_VERSION VERSION_LESS 3.3) + # Allow symbol visibility settings also on static libraries. CMake < 3.3 + # only sets the propery on a shared library build. + cmake_policy(SET CMP0063 NEW) +endif () include(CheckIncludeFile) @@ -345,6 +347,9 @@ target_include_directories( freetype PRIVATE "${PROJECT_SOURCE_DIR}/include") +target_include_directories( + freetype + PUBLIC $