From b5181531e13dc78ef17b6d15f311a4322b448419 Mon Sep 17 00:00:00 2001 From: Pavan Yalamanchili Date: Sun, 15 Nov 2015 11:35:15 -0500 Subject: [PATCH 1/2] Build fix when using system Freetype --- src/font.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/font.cpp b/src/font.cpp index e8027ed8..0592b746 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -19,8 +19,6 @@ #include #include -#include -#include #include FT_FREETYPE_H #ifndef OS_WIN From de0489130b76eb7d8a79cc209bf8450d922d0f92 Mon Sep 17 00:00:00 2001 From: Pavan Yalamanchili Date: Sun, 15 Nov 2015 13:14:44 -0500 Subject: [PATCH 2/2] Use system freetype and glm by default. Download only if unavailable. --- CMakeLists.txt | 2 -- src/CMakeLists.txt | 34 +++++++++++++++------------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34abc32d..c8ae2f78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,6 @@ SET_PROPERTY(CACHE USE_WINDOW_TOOLKIT PROPERTY STRINGS "glfw3" "sdl2") OPTION(BUILD_DOCUMENTATION "Build Documentation" OFF) OPTION(BUILD_EXAMPLES "Build Examples" ON) -OPTION(USE_SYSTEM_GLM "Use system GLM" OFF) -OPTION(USE_SYSTEM_FREETYPE "Use system freetype" OFF) # Set a default build type if none was specified IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87cb3b0a..666b483f 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,26 +1,22 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +# Prior to GLM 0.9.7.0, the package is found by the FindGLM.cmake module. +# This was removed with GLM 0.9.7.0, instead a glm-config.cmake configuration +# file is provided. Therefore, both FIND_PACKAGE calls are necessary. +FIND_PACKAGE(GLM QUIET) +FIND_PACKAGE(glm QUIET) + +IF(NOT glm_FOUND AND NOT GLM_FOUND) + MESSAGE(STATUS "System GLM Not Found.") + MESSAGE(STATUS "Downloading GLM headers.") + INCLUDE("${CMAKE_MODULE_PATH}/build_glm.cmake") +ENDIF() -IF(USE_SYSTEM_GLM) - # Prior to GLM 0.9.7.0, the package is found by the FindGLM.cmake module. - # This was removed with GLM 0.9.7.0, instead a glm-config.cmake configuration - # file is provided. Therefore, both FIND_PACKAGE calls are necessary. - FIND_PACKAGE(GLM QUIET) - FIND_PACKAGE(glm QUIET) - IF(NOT glm_FOUND AND NOT GLM_FOUND) - MESSAGE(FATAL_ERROR "GLM Not Found") - ENDIF() -ELSE(USE_SYSTEM_GLM) - INCLUDE("${CMAKE_MODULE_PATH}/build_glm.cmake") -ENDIF(USE_SYSTEM_GLM) - -IF(USE_SYSTEM_FREETYPE) - FIND_PACKAGE(Freetype REQUIRED) -ELSE(USE_SYSTEM_FREETYPE) - INCLUDE("${CMAKE_MODULE_PATH}/build_freetype.cmake") -ENDIF(USE_SYSTEM_FREETYPE) +FIND_PACKAGE(Freetype QUIET) IF(NOT FREETYPE_FOUND) - MESSAGE(FATAL_ERROR "FreeType Not Found") + MESSAGE(STATUS "System FREETYPE Not Found.") + MESSAGE(STATUS "Downloading and building Freetype libraries.") + INCLUDE("${CMAKE_MODULE_PATH}/build_freetype.cmake") ENDIF() IF(UNIX)