2012-08-04 18:03:53 +00:00
|
|
|
project(pdftohtmlEX)
|
|
|
|
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
|
|
|
|
|
2012-09-05 10:43:37 +00:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src)
|
2012-09-05 09:44:25 +00:00
|
|
|
|
2012-08-04 18:03:53 +00:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(POPPLER REQUIRED poppler)
|
|
|
|
include_directories(${POPPLER_INCLUDE_DIRS})
|
2012-09-05 11:03:23 +00:00
|
|
|
link_directories(${POPPLER_LIBRARY_DIRS})
|
2012-09-05 10:43:37 +00:00
|
|
|
|
2012-09-09 17:40:54 +00:00
|
|
|
find_package(Boost REQUIRED COMPONENTS program_options)
|
2012-08-04 18:03:53 +00:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
2012-09-05 11:03:23 +00:00
|
|
|
link_directories(${Boost_LIBRARY_DIRS})
|
2012-09-05 09:44:25 +00:00
|
|
|
|
2012-09-05 10:43:37 +00:00
|
|
|
find_path(FF_INCLUDE_PATH fontforge/fontforge.h)
|
|
|
|
if(FF_INCLUDE_PATH)
|
|
|
|
message("Found fontforge.h: ${FF_INCLUDE_PATH}/fontforge/fontforge.h")
|
2012-09-06 08:28:49 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${FF_INCLUDE_PATH}/fontforge/config.h")
|
2012-09-05 10:43:37 +00:00
|
|
|
include_directories(${FF_INCLUDE_PATH}/fontforge)
|
2012-09-05 09:44:25 +00:00
|
|
|
else()
|
2012-09-05 10:43:37 +00:00
|
|
|
message(FATAL_ERROR "Error: cannot locate fontforge.h")
|
2012-09-05 09:44:25 +00:00
|
|
|
endif()
|
|
|
|
|
2012-09-07 08:18:57 +00:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
set(FF_LIB_EXT ".so")
|
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
set(FF_LIB_EXT ".dylib")
|
|
|
|
else()
|
|
|
|
message("Set FF_LIB_EXT for your platform!")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_library(FF_LIB libfontforge${FF_LIB_EXT})
|
2012-09-05 10:43:37 +00:00
|
|
|
if(FF_LIB)
|
2012-09-07 08:18:57 +00:00
|
|
|
message("Found libfontforge${FF_LIB_EXT}: ${FF_LIB}")
|
2012-09-05 10:43:37 +00:00
|
|
|
set(FONTFORGE_LIBRARIES ${FF_LIB})
|
|
|
|
else()
|
2012-09-07 08:18:57 +00:00
|
|
|
message(FATAL_ERROR "Error: cannot locate libfontforge${FF_LIB_EXT}")
|
2012-09-05 10:43:37 +00:00
|
|
|
endif()
|
2012-08-04 18:03:53 +00:00
|
|
|
|
2012-09-05 10:43:37 +00:00
|
|
|
message("Looking for libraries of python, which is required by fontforge, if you can link fontforge without python, you may disable this")
|
2012-09-07 05:36:32 +00:00
|
|
|
pkg_search_module(PYTHON python python-2.7)
|
2012-09-04 04:27:06 +00:00
|
|
|
|
2012-09-06 09:38:52 +00:00
|
|
|
set(PDF2HTMLEX_VERSION "0.3")
|
2012-08-27 17:24:01 +00:00
|
|
|
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})
|
2012-08-04 18:03:53 +00:00
|
|
|
|
2012-09-05 09:44:25 +00:00
|
|
|
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")
|
2012-09-03 12:57:14 +00:00
|
|
|
|
2012-08-04 18:03:53 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wunused-function")
|
2012-09-09 06:48:10 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
|
2012-09-04 08:57:46 +00:00
|
|
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
|
2012-08-04 18:03:53 +00:00
|
|
|
|
2012-08-28 06:29:40 +00:00
|
|
|
configure_file (${CMAKE_SOURCE_DIR}/src/config.h.in ${CMAKE_SOURCE_DIR}/src/config.h)
|
2012-08-04 18:03:53 +00:00
|
|
|
|
2012-08-14 05:56:41 +00:00
|
|
|
add_executable(pdf2htmlEX
|
|
|
|
src/pdf2htmlEX.cc
|
|
|
|
src/HTMLRenderer.h
|
2012-08-14 08:23:15 +00:00
|
|
|
src/HTMLRenderer/general.cc
|
2012-08-14 06:35:55 +00:00
|
|
|
src/HTMLRenderer/state.cc
|
|
|
|
src/HTMLRenderer/install.cc
|
|
|
|
src/HTMLRenderer/export.cc
|
2012-08-14 08:23:15 +00:00
|
|
|
src/HTMLRenderer/text.cc
|
|
|
|
src/HTMLRenderer/image.cc
|
2012-08-14 09:13:29 +00:00
|
|
|
src/HTMLRenderer/namespace.h
|
2012-09-04 15:33:15 +00:00
|
|
|
src/HTMLRenderer/LineBuffer.cc
|
2012-09-03 12:57:14 +00:00
|
|
|
src/ff/ff.h
|
|
|
|
src/ff/ff.c
|
2012-08-14 05:56:41 +00:00
|
|
|
src/BackgroundRenderer.h
|
|
|
|
src/BackgroundRenderer.cc
|
2012-09-06 16:58:23 +00:00
|
|
|
src/FontPreprocessor.h
|
|
|
|
src/FontPreprocessor.cc
|
2012-08-14 05:56:41 +00:00
|
|
|
src/Consts.h
|
|
|
|
src/Consts.cc
|
|
|
|
src/util.h
|
2012-09-09 17:18:09 +00:00
|
|
|
src/util.cc
|
2012-08-14 05:56:41 +00:00
|
|
|
src/config.h)
|
|
|
|
|
2012-09-05 10:43:37 +00:00
|
|
|
target_link_libraries(pdf2htmlEX ${POPPLER_LIBRARIES} ${Boost_LIBRARIES} ${FONTFORGE_LIBRARIES} ${PYTHON_LIBRARIES})
|
2012-08-14 05:56:41 +00:00
|
|
|
|
2012-08-15 03:15:33 +00:00
|
|
|
install (TARGETS pdf2htmlEX DESTINATION bin)
|
2012-08-17 10:13:21 +00:00
|
|
|
file (GLOB datafiles share/*)
|
|
|
|
install (FILES ${datafiles} DESTINATION share/pdf2htmlEX)
|
2012-09-01 17:22:40 +00:00
|
|
|
install (FILES pdf2htmlEX.1 DESTINATION share/man/man1)
|