diff options
| author | Slávek Banko <slavek.banko@axis.cz> | 2025-10-27 14:41:30 +0100 |
|---|---|---|
| committer | Slávek Banko <slavek.banko@axis.cz> | 2025-10-27 14:41:30 +0100 |
| commit | e5b8adbd649f602bda9d568eb80856d809176c71 (patch) | |
| tree | 390ff8419085038901c83569ba3238c8efb79e21 | |
| parent | 67b13117ee0c29c76bda0cb2d7e3ef99e2008377 (diff) | |
| download | bibletime-e5b8adbd649f602bda9d568eb80856d809176c71.tar.gz bibletime-e5b8adbd649f602bda9d568eb80856d809176c71.zip | |
Add linking of the clucene-shared library if needed.
This resolve FTBFS when building with the upstream state of the clucene
library, which does not list clucene-shared in the linking libraries.
See Issue #31.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
| -rw-r--r-- | ConfigureChecks.cmake | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 84147b5..86d98b1 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -63,6 +63,42 @@ if( NOT CLUCENE_FOUND ) endif() if( NOT CLUCENE_VERSION VERSION_LESS "2.0" ) set( CLUCENE_V2 1 ) + tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${CLUCENE_INCLUDE_DIRS}" ) + tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "${CLUCENE_LIBRARIES}" ) + check_cxx_source_compiles(" + #include <CLucene.h> + + extern size_t lucene_wcstoutf8 (char *, const wchar_t *, size_t maxslen); + + int main() + { + lucene_wcstoutf8(NULL, NULL, 0); + } + " + BUILD_WITH_CLUCENE_CORE + ) + if( NOT BUILD_WITH_CLUCENE_CORE ) + set( CMAKE_REQUIRED_LIBRARIES "${CLUCENE_LIBRARIES};clucene-shared" ) + check_cxx_source_compiles(" + #include <CLucene.h> + + extern size_t lucene_wcstoutf8 (char *, const wchar_t *, size_t maxslen); + + int main() + { + lucene_wcstoutf8(NULL, NULL, 0); + } + " + BUILD_WITH_CLUCENE_SHARED + ) + if( NOT BUILD_WITH_CLUCENE_SHARED ) + tde_message_fatal( "clucene library was found, but building with clucene is not successful" ) + else() + set( CLUCENE_LIBRARIES "${CLUCENE_LIBRARIES};clucene-shared" CACHE INTERNAL "clucene libraries" FORCE ) + endif() + endif() + tde_restore( CMAKE_REQUIRED_INCLUDES ) + tde_restore( CMAKE_REQUIRED_LIBRARIES ) endif() |
