backport build changes from master (4.0)

This commit is contained in:
Zdenko Podobný 2017-05-05 20:40:12 +02:00
parent 159e34a81d
commit 5fe49627bf
2 changed files with 68 additions and 14 deletions

View File

@ -10,6 +10,12 @@
cmake_minimum_required(VERSION 2.8.11)
if (NOT APPVEYOR)
if (WIN32 AND (CMAKE_VERSION VERSION_EQUAL 3.6 OR (CMAKE_VERSION VERSION_GREATER 3.6 AND CMAKE_VERSION VERSION_LESS 3.7)))
message(FATAL_ERROR "You have bugged CMake version 3.6 which is known to not work with tesseract. Please, upgrade CMake.")
endif()
endif()
# In-source builds are disabled.
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR
@ -113,12 +119,7 @@ include(Configure)
configure_file(${AUTOCONFIG_SRC} ${AUTOCONFIG} @ONLY)
set(INCLUDE_DIR
${CMAKE_SOURCE_DIR}/api
${CMAKE_SOURCE_DIR}/ccmain
${CMAKE_SOURCE_DIR}/ccstruct
${CMAKE_SOURCE_DIR}/ccutil
)
set(INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" "${CMAKE_INSTALL_PREFIX}/include/tesseract")
configure_file(
${CMAKE_SOURCE_DIR}/cmake/templates/TesseractConfig-version.cmake.in
@ -253,4 +254,57 @@ if (BUILD_TRAINING_TOOLS)
add_subdirectory(training)
endif()
get_target_property(tesseract_NAME libtesseract NAME)
get_target_property(tesseract_VERSION libtesseract VERSION)
get_target_property(tesseract_OUTPUT_NAME libtesseract OUTPUT_NAME)
configure_file(tesseract.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc DESTINATION lib/pkgconfig)
install(TARGETS tesseract RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
install(TARGETS libtesseract EXPORT TesseractTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
install(EXPORT TesseractTargets DESTINATION cmake)
install(FILES
${CMAKE_BINARY_DIR}/TesseractConfig.cmake
${CMAKE_BINARY_DIR}/TesseractConfig-version.cmake
DESTINATION cmake)
install(FILES
# from api/makefile.am
api/apitypes.h
api/baseapi.h
api/capi.h
api/renderer.h
#from ccmain/makefile.am
ccmain/thresholder.h
ccmain/ltrresultiterator.h
ccmain/pageiterator.h
ccmain/resultiterator.h
ccmain/osdetect.h
#from ccstruct/makefile.am
ccstruct/publictypes.h
#from ccutil/makefile.am
ccutil/basedir.h
ccutil/errcode.h
ccutil/fileerr.h
ccutil/genericvector.h
ccutil/helpers.h
ccutil/host.h
ccutil/memry.h
ccutil/ndminx.h
ccutil/ocrclass.h
ccutil/params.h
ccutil/platform.h
ccutil/serialis.h
ccutil/strngs.h
ccutil/tesscallback.h
ccutil/unichar.h
ccutil/unicharmap.h
ccutil/unicharset.h
#${CMAKE_BINARY_DIR}/src/endianness.h
DESTINATION include/tesseract)
###############################################################################

View File

@ -38,14 +38,14 @@ dist-hook:
# Need to remove .svn directories from directories
# added using EXTRA_DIST. $(distdir)/tessdata would in
# theory suffice.
rm -rf `find $(distdir) -name .svn`
rm -rf `find $(distdir) -name .git`
rm -rf `find $(distdir) -name .deps`
rm -rf `find $(distdir) -name .libs`
rm -rf `find $(distdir) -name *.o`
rm -rf `find $(distdir) -name *.lo`
rm -rf `find $(distdir) -name *.la`
rm -rf `find $(distdir)/training -executable -type f`
rm -rf $(find $(distdir) -name .svn)
rm -rf $(find $(distdir) -name .git)
rm -rf $(find $(distdir) -name .deps)
rm -rf $(find $(distdir) -name .libs)
rm -rf $(find $(distdir) -name *.o)
rm -rf $(find $(distdir) -name *.lo)
rm -rf $(find $(distdir) -name *.la)
rm -rf $(find $(distdir)/training -executable -type f)
rm -rf $(distdir)/doc/html/*
ScrollView.jar: