diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/FindFreetype.cmake | 47 | 
1 files changed, 25 insertions, 22 deletions
| diff --git a/modules/FindFreetype.cmake b/modules/FindFreetype.cmake index d2821931..6fd1bb13 100644 --- a/modules/FindFreetype.cmake +++ b/modules/FindFreetype.cmake @@ -2,9 +2,10 @@  # Once done this will define  #  #  FREETYPE_FOUND - system has Freetype -#  FREETYPE_INCLUDE_DIR - the FREETYPE include directory +#  FREETYPE_INCLUDE_DIRS - the FREETYPE include directories  #  FREETYPE_LIBRARIES - Link these to use FREETYPE -# +#  FREETYPE_INCLUDE_DIR - internal +  # Copyright (c) 2006, Laurent Montel, <montel@kde.org>  #  # Redistribution and use is allowed according to the terms of the BSD license. @@ -18,7 +19,7 @@ if (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR)  else (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR) -  FIND_PROGRAM(FREETYPECONFIG_EXECUTABLE NAMES freetype-config PATHS +  find_program(FREETYPECONFIG_EXECUTABLE NAMES freetype-config PATHS       /opt/local/bin    ) @@ -29,28 +30,28 @@ else (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR)    # if freetype-config has been found    if(FREETYPECONFIG_EXECUTABLE) -    EXEC_PROGRAM(${FREETYPECONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE FREETYPE_LIBRARIES) +    exec_program(${FREETYPECONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE FREETYPE_LIBRARIES) -    EXEC_PROGRAM(${FREETYPECONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _freetype_pkgconfig_output) +    exec_program(${FREETYPECONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _freetype_pkgconfig_output)      if(FREETYPE_LIBRARIES AND _freetype_pkgconfig_output)        set(FREETYPE_FOUND TRUE)        # freetype-config can print out more than one -I, so we need to chop it up        # into a list and process each entry separately -      SEPARATE_ARGUMENTS(_freetype_pkgconfig_output) -      FOREACH(value ${_freetype_pkgconfig_output}) -        STRING(REGEX REPLACE "-I(.+)" "\\1" value "${value}") +      separate_arguments(_freetype_pkgconfig_output) +      foreach(value ${_freetype_pkgconfig_output}) +        string(REGEX REPLACE "-I(.+)" "\\1" value "${value}")          set(FREETYPE_INCLUDE_DIR ${FREETYPE_INCLUDE_DIR} ${value}) -      ENDFOREACH(value) +      endforeach(value)      endif(FREETYPE_LIBRARIES AND _freetype_pkgconfig_output) -    MARK_AS_ADVANCED(FREETYPE_LIBRARIES FREETYPE_INCLUDE_DIR) +    set( FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} CACHE STRING "The libraries for freetype" ) -    set( FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} CACHE INTERNAL "The libraries for freetype" ) +    mark_as_advanced(FREETYPE_LIBRARIES FREETYPE_INCLUDE_DIR)    else(FREETYPECONFIG_EXECUTABLE) -	find_path (FREETYPE_INCLUDE_DIR freetype2/freetype/freetype.h) -	set (FREETYPE_INCLUDE_DIR ${FREETYPE_INCLUDE_DIR}/freetype2) +    find_path (FREETYPE_INCLUDE_DIR freetype2/freetype/freetype.h) +    set (FREETYPE_INCLUDE_DIR ${FREETYPE_INCLUDE_DIR}/freetype2)      find_library(FREETYPE_LIBRARIES freetype)      if(FREETYPE_INCLUDE_DIR AND FREETYPE_LIBRARIES)          set(FREETYPE_FOUND TRUE) @@ -58,14 +59,16 @@ else (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR)    endif(FREETYPECONFIG_EXECUTABLE) -  IF (FREETYPE_FOUND) -    IF (NOT Freetype_FIND_QUIETLY) -       MESSAGE(STATUS "Found Freetype: ${FREETYPE_LIBRARIES}") -    ENDIF (NOT Freetype_FIND_QUIETLY) -  ELSE (FREETYPE_FOUND) -    IF (Freetype_FIND_REQUIRED) -       MESSAGE(FATAL_ERROR "Could not find FreeType library") -    ENDIF (Freetype_FIND_REQUIRED) -  ENDIF (FREETYPE_FOUND) +  if (FREETYPE_FOUND) +    if (NOT Freetype_FIND_QUIETLY) +       message(STATUS "Found Freetype: ${FREETYPE_LIBRARIES}") +    endif (NOT Freetype_FIND_QUIETLY) +  else (FREETYPE_FOUND) +    if (Freetype_FIND_REQUIRED) +       message(FATAL_ERROR "Could not find FreeType library") +    endif (Freetype_FIND_REQUIRED) +  endif (FREETYPE_FOUND)  endif (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR) + +set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR}") | 
