-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 1.46 KB
/
CMakeLists.txt
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
cmake_minimum_required( VERSION 2.8.4 )
project( PageXML )
set( lib_NAME PageXML )
#list( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" )
#include( FindPackageHandleStandardArgs )
#find_package( Ghostscript )
find_package( PkgConfig )
pkg_check_modules( libxslt REQUIRED libxslt )
#pkg_check_modules( gdal REQUIRED gdal )
#pkg_check_modules( Magick REQUIRED Magick++>=6.8 )
#pkg_check_modules( opencv opencv4 )
#if( NOT opencv_CFLAGS )
# pkg_check_modules( opencv REQUIRED opencv>=2.4 )
#endif()
#add_definitions( -D__PAGEXML_OGR__ )
#add_definitions( -D__PAGEXML_MAGICK__ )
#add_definitions( -D__PAGEXML_IMG_CV__ )
#add_definitions( -D__PAGEXML_IMG_MAGICK__ )
#add_definitions( -D__PAGEXML_GS__ )
add_definitions( -D__PAGEXML_SLIM__ )
#set( CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${GHOSTSCRIPT_INCLUDES};${opencv_INCLUDE_DIRS}" )
#file( GLOB lib_SRC "*.cc" )
file( GLOB lib_SRC "PageXML.cc" )
add_library( ${lib_NAME} SHARED ${lib_SRC} )
set_property( TARGET ${lib_NAME} PROPERTY CXX_STANDARD 11 )
string( REPLACE ";" " " CFLAGS_STR "-Wall -W ${gdal_CFLAGS} ${opencv_CFLAGS} ${libxslt_CFLAGS} ${Magick_CFLAGS}" )
set_target_properties( ${lib_NAME} PROPERTIES COMPILE_FLAGS "${CFLAGS_STR}" )
include_directories( SYSTEM ${Magick_INCLUDEDIR} ) # To suppress system header warnings
target_link_libraries( ${lib_NAME} ${gdal_LDFLAGS} ${GHOSTSCRIPT_LIBRARIES} ${opencv_LDFLAGS} ${libxslt_LDFLAGS} ${Magick_LDFLAGS} )
install( TARGETS ${lib_NAME} DESTINATION lib )