From 30e2516337a735417bca5220619590a7570179e5 Mon Sep 17 00:00:00 2001 From: Shatur95 Date: Fri, 11 Dec 2020 18:05:09 +0200 Subject: [PATCH 1/3] Use find_dependency instead of find_package --- cmake/templates/TesseractConfig.cmake.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/templates/TesseractConfig.cmake.in b/cmake/templates/TesseractConfig.cmake.in index 06e05643..9dddadf8 100644 --- a/cmake/templates/TesseractConfig.cmake.in +++ b/cmake/templates/TesseractConfig.cmake.in @@ -15,9 +15,10 @@ # # =================================================================================== -include(${CMAKE_CURRENT_LIST_DIR}/tesseract/TesseractTargets.cmake) +include(CMakeFindDependencyMacro) +find_dependency(Leptonica) -find_package(Leptonica REQUIRED) +include(${CMAKE_CURRENT_LIST_DIR}/tesseract/TesseractTargets.cmake) @PACKAGE_INIT@ From 8719498c197f102f582264da886fd8c6e4262902 Mon Sep 17 00:00:00 2001 From: Shatur95 Date: Fri, 11 Dec 2020 18:24:51 +0200 Subject: [PATCH 2/3] Locate CMake config files without subfolder --- CMakeLists.txt | 6 +++--- cmake/templates/TesseractConfig.cmake.in | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43628ec8..d07d8cfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,11 +374,11 @@ configure_file( include(CMakePackageConfigHelpers) configure_package_config_file( cmake/templates/TesseractConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/cmake/TesseractConfig.cmake - INSTALL_DESTINATION lib/tesseract/cmake + ${CMAKE_CURRENT_BINARY_DIR}/cmake/tesseract/TesseractConfig.cmake + INSTALL_DESTINATION lib/cmake/tesseract PATH_VARS INCLUDE_DIR) write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/cmake/TesseractConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/cmake/tesseract/TesseractConfigVersion.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY SameMajorVersion) diff --git a/cmake/templates/TesseractConfig.cmake.in b/cmake/templates/TesseractConfig.cmake.in index 9dddadf8..c9840363 100644 --- a/cmake/templates/TesseractConfig.cmake.in +++ b/cmake/templates/TesseractConfig.cmake.in @@ -18,7 +18,7 @@ include(CMakeFindDependencyMacro) find_dependency(Leptonica) -include(${CMAKE_CURRENT_LIST_DIR}/tesseract/TesseractTargets.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/TesseractTargets.cmake) @PACKAGE_INIT@ From 068b79052f45ef8f5a52799df98a63593fd8d607 Mon Sep 17 00:00:00 2001 From: Shatur95 Date: Fri, 11 Dec 2020 18:25:08 +0200 Subject: [PATCH 3/3] Fix typo --- cmake/templates/TesseractConfig.cmake.in | 2 +- test | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 160000 test diff --git a/cmake/templates/TesseractConfig.cmake.in b/cmake/templates/TesseractConfig.cmake.in index c9840363..8e32e660 100644 --- a/cmake/templates/TesseractConfig.cmake.in +++ b/cmake/templates/TesseractConfig.cmake.in @@ -22,7 +22,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/TesseractTargets.cmake) @PACKAGE_INIT@ -set_and_check(Tesseract_INCLUDE_DIR "@PACKAGE_INCLUDE_DIR@") +set_and_check(Tesseract_INCLUDE_DIRS "@PACKAGE_INCLUDE_DIR@") set(Tesseract_LIBRARIES libtesseract) check_required_components(Tesseract) diff --git a/test b/test deleted file mode 160000 index e27d9566..00000000 --- a/test +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e27d9566917d7d167636a7d0cd59bcfb2c61c7eb