From 4bd125b03246b841c230a6506c08ac0dba7aaaef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zdenko=20Podobn=C3=BD?= Date: Mon, 10 Jun 2024 12:43:33 +0200 Subject: [PATCH] cmake: install pdb files only for MSVC build --- CMakeLists.txt | 8 ++++- src/training/CMakeLists.txt | 71 +++++++++++++++++++++++++++---------- 2 files changed, 60 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45649334..0dec1896 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -927,13 +927,19 @@ install( DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig RENAME tesseract.pc) install(TARGETS tesseract DESTINATION bin) -install(FILES $ DESTINATION bin OPTIONAL) +if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) +endif() install( TARGETS libtesseract EXPORT TesseractTargets RUNTIME DESTINATION bin + RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) +endif() install( EXPORT TesseractTargets NAMESPACE Tesseract:: diff --git a/src/training/CMakeLists.txt b/src/training/CMakeLists.txt index 7ea63ecf..7fbf0212 100644 --- a/src/training/CMakeLists.txt +++ b/src/training/CMakeLists.txt @@ -126,7 +126,9 @@ install( ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) generate_export_header(common_training EXPORT_MACRO_NAME TESS_COMMON_TRAINING_API) -install(FILES $ DESTINATION bin OPTIONAL) +if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) +endif() project_group(common_training "Training Tools") # ############################################################################## @@ -142,7 +144,9 @@ if(NOT DISABLED_LEGACY_ENGINE) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() endif() # ############################################################################## @@ -158,7 +162,9 @@ if(NOT DISABLED_LEGACY_ENGINE) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() endif() # ############################################################################## @@ -173,7 +179,9 @@ install( RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -install(FILES $ DESTINATION bin OPTIONAL) +if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) +endif() # ############################################################################## # EXECUTABLE cntraining @@ -188,7 +196,9 @@ if(NOT DISABLED_LEGACY_ENGINE) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() endif() # ############################################################################## @@ -203,7 +213,10 @@ install( RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -install(FILES $ DESTINATION bin OPTIONAL) +if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) +endif() + # ############################################################################## # EXECUTABLE mftraining # ############################################################################## @@ -217,7 +230,9 @@ if(NOT DISABLED_LEGACY_ENGINE) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() endif() # ############################################################################## @@ -233,7 +248,9 @@ if(NOT DISABLED_LEGACY_ENGINE) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() endif() # ############################################################################## @@ -248,9 +265,11 @@ install( RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -install(FILES $ DESTINATION bin OPTIONAL) -if(ICU_FOUND) +if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) +endif() +if(ICU_FOUND) if(NOT SW_BUILD) include_directories(${ICU_INCLUDE_DIRS}) endif() @@ -279,7 +298,9 @@ if(ICU_FOUND) RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() generate_export_header(unicharset_training EXPORT_MACRO_NAME TESS_UNICHARSET_TRAINING_API) project_group(unicharset_training "Training Tools") @@ -296,7 +317,9 @@ if(ICU_FOUND) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() # ############################################################################ # EXECUTABLE lstmeval @@ -310,7 +333,9 @@ if(ICU_FOUND) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() # ############################################################################ # EXECUTABLE lstmtraining @@ -324,7 +349,9 @@ if(ICU_FOUND) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() # ############################################################################ # EXECUTABLE merge_unicharsets @@ -338,7 +365,9 @@ if(ICU_FOUND) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() # ############################################################################ # EXECUTABLE set_unicharset_properties @@ -352,7 +381,9 @@ if(ICU_FOUND) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() # ############################################################################ # EXECUTABLE unicharset_extractor @@ -367,7 +398,9 @@ if(ICU_FOUND) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() # ############################################################################ @@ -424,7 +457,9 @@ if(ICU_FOUND) RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(FILES $ DESTINATION bin OPTIONAL) + if (MSVC) + install(FILES $ DESTINATION bin OPTIONAL) + endif() endif() endif(ICU_FOUND)