Skip to content

Commit

Permalink
Merge pull request #62 from pavanky/build_fixes
Browse files Browse the repository at this point in the history
Build fixes for system Freetype and GLM
  • Loading branch information
9prady9 committed Nov 15, 2015
2 parents e40b30a + de04891 commit 71a1fe6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
34 changes: 15 additions & 19 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <glm/gtx/transform.hpp>

#include <ft2build.h>
#include <freetype.h>
#include <ftglyph.h>
#include FT_FREETYPE_H

#ifndef OS_WIN
Expand Down

0 comments on commit 71a1fe6

Please sign in to comment.