1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(FTGL)
SET(CMAKE_MODULE_PATH ${FTGL_SOURCE_DIR})
SET(VERSION_SERIES 2)
SET(VERSION_MAJOR 1)
SET(VERSION_MINOR 3)
SET(FTGL_SOVERSION 1)
FIND_PACKAGE(Freetype REQUIRED) # if it fails, check this: https://bugs.launchpad.net/ubuntu/+source/cmake/+bug/826988
FIND_PACKAGE(OpenGL REQUIRED)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/FTFont)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/FTGL)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/FTGlyph)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/FTLayout)
INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
# Allow the developer to select if Dynamic or Static libraries are built
OPTION(BUILD_SHARED_LIBS "Build Shared Libraries" ON)
IF(BUILD_SHARED_LIBS)
SET(LIB_TYPE SHARED)
ELSE(BUILD_SHARED_LIBS)
SET(LIB_TYPE STATIC)
ADD_DEFINITIONS(-DFTGL_LIBRARY_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ADD_CUSTOM_TARGET(doc)
FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
ADD_CUSTOM_TARGET(doxygen
${DOXYGEN_EXECUTABLE}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Doxygen ...")
ADD_DEPENDENCIES(doc doxygen)
ENDIF(DOXYGEN_FOUND)
SUBDIRS(src)
OPTION(BUILD_TESTS "Build Unit Tests" OFF)
IF(BUILD_TESTS)
SUBDIRS(test)
ENDIF(BUILD_TESTS)
IF(NOT DEFINED FTGL_CMAKE_FINDER_INSTALL_DIR)
SET(FTGL_CMAKE_FINDER_INSTALL_DIR "share/cmake-2.8/Modules")
ENDIF( NOT DEFINED FTGL_CMAKE_FINDER_INSTALL_DIR)
INSTALL(FILES ${PROJECT_SOURCE_DIR}/cmake/FindFTGL.cmake DESTINATION
${CMAKE_INSTALL_PREFIX}/${FTGL_CMAKE_FINDER_INSTALL_DIR})