mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-09-28 17:21:29 +00:00
89 lines
3.0 KiB
CMake
89 lines
3.0 KiB
CMake
project(pdftohtmlEX)
|
|
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src/include)
|
|
|
|
find_package(PkgConfig)
|
|
pkg_check_modules(POPPLER REQUIRED poppler>=0.20.0)
|
|
include_directories(${POPPLER_INCLUDE_DIRS})
|
|
link_directories(${POPPLER_LIBRARY_DIRS})
|
|
|
|
find_path(FF_INCLUDE_PATH fontforge/fontforge.h)
|
|
if(FF_INCLUDE_PATH)
|
|
message("Found fontforge.h: ${FF_INCLUDE_PATH}/fontforge/fontforge.h")
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${FF_INCLUDE_PATH}/fontforge/config.h")
|
|
include_directories(${FF_INCLUDE_PATH}/fontforge)
|
|
else()
|
|
message(FATAL_ERROR "Error: cannot locate fontforge.h")
|
|
endif()
|
|
|
|
foreach(FF_LIB_NAME
|
|
${CMAKE_IMPORT_LIBRARY_PREFIX}fontforge${CMAKE_IMPORT_LIBRARY_SUFFIX}
|
|
${CMAKE_SHARED_LIBRARY_PREFIX}fontforge${CMAKE_SHARED_LIBRARY_SUFFIX}
|
|
${CMAKE_STATIC_LIBRARY_PREFIX}fontforge${CMAKE_STATIC_LIBRARY_SUFFIX}
|
|
)
|
|
find_library(FF_LIB ${FF_LIB_NAME})
|
|
if(FF_LIB)
|
|
message("Found ${FF_LIB_NAME}: ${FF_LIB}")
|
|
set(FONTFORGE_LIBRARIES ${FF_LIB})
|
|
break()
|
|
endif()
|
|
endforeach()
|
|
|
|
if(NOT FF_LIB)
|
|
set(FONTFORGE_LIBRARIES fontforge)
|
|
message("Error: cannot locate ${FF_LIB_NAME}")
|
|
endif()
|
|
|
|
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_VERSION "0.3")
|
|
set(ARCHIVE_NAME pdf2htmlex-${PDF2HTMLEX_VERSION})
|
|
add_custom_target(dist
|
|
COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD
|
|
| bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused-function")
|
|
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wunused-function")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
|
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
|
|
|
|
configure_file (${CMAKE_SOURCE_DIR}/src/include/pdf2htmlEX-config.h.in ${CMAKE_SOURCE_DIR}/src/include/pdf2htmlEX-config.h)
|
|
|
|
add_executable(pdf2htmlEX
|
|
src/pdf2htmlEX.cc
|
|
src/include/HTMLRenderer.h
|
|
src/HTMLRenderer/general.cc
|
|
src/HTMLRenderer/state.cc
|
|
src/HTMLRenderer/install.cc
|
|
src/HTMLRenderer/export.cc
|
|
src/HTMLRenderer/text.cc
|
|
src/HTMLRenderer/image.cc
|
|
src/include/namespace.h
|
|
src/HTMLRenderer/LineBuffer.cc
|
|
src/include/ff.h
|
|
src/ff.c
|
|
src/include/BackgroundRenderer.h
|
|
src/BackgroundRenderer.cc
|
|
src/include/FontPreprocessor.h
|
|
src/FontPreprocessor.cc
|
|
src/include/util.h
|
|
src/util.cc
|
|
src/include/ArgParser.h
|
|
src/ArgParser.cc
|
|
src/include/pdf2htmlEX-config.h
|
|
)
|
|
|
|
target_link_libraries(pdf2htmlEX ${POPPLER_LIBRARIES} ${FONTFORGE_LIBRARIES} ${PYTHON_LIBRARIES})
|
|
|
|
install (TARGETS pdf2htmlEX DESTINATION bin)
|
|
file (GLOB datafiles share/*)
|
|
install (FILES ${datafiles} DESTINATION share/pdf2htmlEX)
|
|
install (FILES pdf2htmlEX.1 DESTINATION share/man/man1)
|