Hide pango and cairo includes from targets that do not use it.

This commit is contained in:
Egor Pugin 2015-09-07 12:49:08 +03:00
parent da3852dc77
commit 670e0fafb3
2 changed files with 53 additions and 57 deletions

View File

@ -50,18 +50,6 @@ find_package(ICU COMPONENTS uc i18n)
find_package(OpenCL QUIET)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(Pango pango)
pkg_check_modules(Cairo cairo)
pkg_check_modules(PangoFt2 pangoft2)
pkg_check_modules(PangoCairo pangocairo)
pkg_check_modules(FontConfig fontconfig)
include_directories(${ICU_INCLUDE_DIRS})
include_directories(${Pango_INCLUDE_DIRS})
include_directories(${Cairo_INCLUDE_DIRS})
endif()
###############################################################################
#
# compiler and linker

View File

@ -8,8 +8,8 @@ if (STATIC OR NOT (WIN32 OR CYGWIN))
# LIBRARY tessopt
########################################
add_library (tessopt tessopt.cpp tessopt.h)
project_group (tessopt "Training Tools")
add_library (tessopt tessopt.cpp tessopt.h)
project_group (tessopt "Training Tools")
########################################
@ -24,103 +24,99 @@ set(common_training_hdr
commandlineflags.h
commontraining.h
)
add_library (common_training ${common_training_src} ${common_training_hdr})
target_link_libraries (common_training tesseract tessopt)
project_group (common_training "Training Tools")
add_library (common_training ${common_training_src} ${common_training_hdr})
target_link_libraries (common_training tesseract tessopt)
project_group (common_training "Training Tools")
########################################
# EXECUTABLE ambiguous_words
########################################
add_executable (ambiguous_words ambiguous_words.cpp)
target_link_libraries (ambiguous_words tesseract)
project_group (ambiguous_words "Training Tools")
add_executable (ambiguous_words ambiguous_words.cpp)
target_link_libraries (ambiguous_words tesseract)
project_group (ambiguous_words "Training Tools")
########################################
# EXECUTABLE classifier_tester
########################################
add_executable (classifier_tester classifier_tester.cpp)
target_link_libraries (classifier_tester common_training)
project_group (classifier_tester "Training Tools")
add_executable (classifier_tester classifier_tester.cpp)
target_link_libraries (classifier_tester common_training)
project_group (classifier_tester "Training Tools")
########################################
# EXECUTABLE combine_tessdata
########################################
add_executable (combine_tessdata combine_tessdata.cpp)
target_link_libraries (combine_tessdata tesseract)
project_group (combine_tessdata "Training Tools")
add_executable (combine_tessdata combine_tessdata.cpp)
target_link_libraries (combine_tessdata tesseract)
project_group (combine_tessdata "Training Tools")
########################################
# EXECUTABLE cntraining
########################################
add_executable (cntraining cntraining.cpp)
target_link_libraries (cntraining common_training)
project_group (cntraining "Training Tools")
add_executable (cntraining cntraining.cpp)
target_link_libraries (cntraining common_training)
project_group (cntraining "Training Tools")
########################################
# EXECUTABLE dawg2wordlist
########################################
add_executable (dawg2wordlist dawg2wordlist.cpp)
target_link_libraries (dawg2wordlist tesseract)
project_group (dawg2wordlist "Training Tools")
add_executable (dawg2wordlist dawg2wordlist.cpp)
target_link_libraries (dawg2wordlist tesseract)
project_group (dawg2wordlist "Training Tools")
########################################
# EXECUTABLE mftraining
########################################
add_executable (mftraining mftraining.cpp mergenf.cpp mergenf.h)
target_link_libraries (mftraining common_training)
project_group (mftraining "Training Tools")
add_executable (mftraining mftraining.cpp mergenf.cpp mergenf.h)
target_link_libraries (mftraining common_training)
project_group (mftraining "Training Tools")
########################################
# EXECUTABLE shapeclustering
########################################
add_executable (shapeclustering shapeclustering.cpp)
target_link_libraries (shapeclustering common_training)
project_group (shapeclustering "Training Tools")
add_executable (shapeclustering shapeclustering.cpp)
target_link_libraries (shapeclustering common_training)
project_group (shapeclustering "Training Tools")
########################################
# EXECUTABLE unicharset_extractor
########################################
add_executable (unicharset_extractor unicharset_extractor.cpp)
target_link_libraries (unicharset_extractor tesseract tessopt)
project_group (unicharset_extractor "Training Tools")
add_executable (unicharset_extractor unicharset_extractor.cpp)
target_link_libraries (unicharset_extractor tesseract tessopt)
project_group (unicharset_extractor "Training Tools")
########################################
# EXECUTABLE wordlist2dawg
########################################
add_executable (wordlist2dawg wordlist2dawg.cpp)
target_link_libraries (wordlist2dawg tesseract)
project_group (wordlist2dawg "Training Tools")
add_executable (wordlist2dawg wordlist2dawg.cpp)
target_link_libraries (wordlist2dawg tesseract)
project_group (wordlist2dawg "Training Tools")
###############################################################################
if (PKG_CONFIG_FOUND)
add_definitions(-DPANGO_ENABLE_ENGINE)
########################################
# EXECUTABLE set_unicharset_properties
########################################
add_executable (set_unicharset_properties
if (ICU_FOUND)
add_executable (set_unicharset_properties
set_unicharset_properties.cpp
unicharset_training_utils.cpp
unicharset_training_utils.h
@ -130,14 +126,24 @@ add_executable (set_unicharset_properties
normstrngs.h
icuerrorcode.h
)
target_link_libraries (set_unicharset_properties common_training ${ICU_LIBRARIES})
project_group (set_unicharset_properties "Training Tools")
#target_include_directories (set_unicharset_properties PRIVATE ${ICU_INCLUDE_DIRS})
target_link_libraries (set_unicharset_properties common_training ${ICU_LIBRARIES})
project_group (set_unicharset_properties "Training Tools")
endif (ICU_FOUND)
########################################
# EXECUTABLE text2image
########################################
if (ICU_FOUND AND PKG_CONFIG_FOUND)
pkg_check_modules(Pango REQUIRED pango)
pkg_check_modules(Cairo REQUIRED cairo)
pkg_check_modules(PangoFt2 REQUIRED pangoft2)
pkg_check_modules(PangoCairo REQUIRED pangocairo)
pkg_check_modules(FontConfig REQUIRED fontconfig)
set(text2image_src
text2image.cpp
boxchar.cpp
@ -163,8 +169,10 @@ if (CYGWIN)
set(text2image_src ${text2image_src} ../vs2010/port/strcasestr.cpp)
endif()
add_executable (text2image ${text2image_src})
target_link_libraries (text2image tesseract common_training
add_executable (text2image ${text2image_src})
target_include_directories (text2image BEFORE PRIVATE ${Cairo_INCLUDE_DIRS} ${Pango_INCLUDE_DIRS})
target_compile_definitions (text2image PRIVATE -DPANGO_ENABLE_ENGINE)
target_link_libraries (text2image tesseract common_training
${ICU_LIBRARIES}
${Pango_LIBRARIES}
${Cairo_LIBRARIES}
@ -172,9 +180,9 @@ target_link_libraries (text2image tesseract common_training
${PangoFt2_LIBRARIES}
${FontConfig_LIBRARIES}
)
project_group (text2image "Training Tools")
project_group (text2image "Training Tools")
endif(PKG_CONFIG_FOUND)
endif(ICU_FOUND AND PKG_CONFIG_FOUND)
endif(STATIC OR NOT (WIN32 OR CYGWIN))
###############################################################################