1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

remove support for old versions of fontforge

This commit is contained in:
Lu Wang 2014-03-22 22:36:22 +08:00
parent 2c9da6661f
commit 15ac5271a7
2 changed files with 6 additions and 67 deletions

View File

@ -72,73 +72,10 @@ if(ENABLE_SVG)
endif() endif()
# fontforge starts using pkg-config 'correctly' since 2.0.0 # fontforge starts using pkg-config 'correctly' since 2.0.0
pkg_check_modules(FONTFORGE libfontforge>=2.0.0) pkg_check_modules(FONTFORGE REQUIRED libfontforge>=2.0.0)
if(FONTFORGE_FOUND)
include_directories(${FONTFORGE_INCLUDE_DIRS}) include_directories(${FONTFORGE_INCLUDE_DIRS})
link_directories(${FONTFORGE_LIBRARY_DIRS}) link_directories(${FONTFORGE_LIBRARY_DIRS})
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FONTFORGE_LIBRARIES}) set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FONTFORGE_LIBRARIES})
else()
message("Trying to locate old versions of fontforge...")
find_path(FF_INCLUDE_PATH fontforge/fontforge.h)
if(FF_INCLUDE_PATH)
message("Found fontforge.h: ${FF_INCLUDE_PATH}/fontforge/fontforge.h")
set(FONTFORGE_INCLUDE_DIRS ${FF_INCLUDE_PATH}/fontforge)
include_directories(${FONTFORGE_INCLUDE_DIRS})
# MacOSX gettext is in /opt/local/include - strange
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_path(GETTEXT_INCLUDE_PATH libintl.h HINTS "/usr/local/opt/gettext/include") # homebrew
if(GETTEXT_INCLUDE_PATH)
include_directories(${GETTEXT_INCLUDE_PATH})
else()
message("Cannot found libintl.h, if you see errors about libintl.h, add the path to gettext header files into your include paths")
endif()
endif()
else()
message(FATAL_ERROR "Error: cannot locate fontforge.h")
endif()
find_path(FF_CONFIG_INCLUDE_PATH config.h PATHS ${FONTFORGE_INCLUDE_DIRS} NO_DEFAULT_PATH)
if(FF_CONFIG_INCLUDE_PATH)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${FF_CONFIG_INCLUDE_PATH}/config.h")
message("Found config.h: ${FF_CONFIG_INCLUDE_PATH}/config.h")
else()
message("Cannot locate config.h for fontforge")
endif()
macro(wl_find_library LIB_NAME RESULT)
unset(${RESULT})
unset(${RESULT} CACHE)
foreach(FULL_LIB_NAME
${CMAKE_IMPORT_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}
${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
${CMAKE_STATIC_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
)
find_library(FULL_LIB ${FULL_LIB_NAME})
if(FULL_LIB)
message("Found ${LIB_NAME}: ${FULL_LIB}")
set(${RESULT} ${FULL_LIB})
break()
endif()
endforeach()
unset(FULL_LIB_NAME)
unset(FULL_LIB_NAME CACHE)
unset(FULL_LIB)
unset(FULL_LIB CACHE)
endmacro()
wl_find_library(fontforge FONTFORGE_LIBRARIES)
if(NOT DEFINED FONTFORGE_LIBRARIES)
set(FONTFORGE_LIBRARIES fontforge)
message("Error: cannot locate fontforge")
endif()
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FONTFORGE_LIBRARIES})
wl_find_library(gunicode GUNICODE_LIBRARIES)
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${GUNICODE_LIBRARIES})
message("Looking for libraries of python, which is required by fontforge, if you can link fontforge without python, you may disable this")
pkg_search_module(PYTHON python python-2.7)
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${PYTHON_LIBRARIES})
endif()
# debug build flags (overwrite default cmake debug flags) # debug build flags (overwrite default cmake debug flags)
set(CMAKE_C_FLAGS_DEBUG "-ggdb -pg") set(CMAKE_C_FLAGS_DEBUG "-ggdb -pg")

View File

@ -1,5 +1,7 @@
Developing v0.12 Developing v0.12
* Do not support Fontforge < 2.0.0 any more
v0.11 v0.11
2014.01.19 2014.01.19