summaryrefslogtreecommitdiff
path: root/cmake/FindCLucene.cmake
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
commit7a00574163029c0c2b649878c95d5acbd083564a (patch)
treec13cc5736025834df2874ed87ee8598070025ea6 /cmake/FindCLucene.cmake
parentb745315323de9f27538edac9453205ca70e6186e (diff)
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'cmake/FindCLucene.cmake')
-rw-r--r--cmake/FindCLucene.cmake34
1 files changed, 17 insertions, 17 deletions
diff --git a/cmake/FindCLucene.cmake b/cmake/FindCLucene.cmake
index c5a6450..00d2055 100644
--- a/cmake/FindCLucene.cmake
+++ b/cmake/FindCLucene.cmake
@@ -62,18 +62,11 @@ SET(TRIAL_INCLUDE_PATHS
FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY
NAMES clucene clucene-core
PATHS ${TRIAL_LIBRARY_PATHS})
-IF (CLUCENE_LIBRARY)
- MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}")
-ENDIF (CLUCENE_LIBRARY)
FIND_PATH(CLUCENE_INCLUDE_DIR
NAMES CLucene.h
PATHS ${TRIAL_INCLUDE_PATHS}
ONLY_CMAKE_FIND_ROOT_PATH)
-IF (CLUCENE_INCLUDE_DIR)
- MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}")
-ENDIF (CLUCENE_INCLUDE_DIR)
-
IF(WIN32)
SET(TRIAL_LIBRARY_PATHS ${CLUCENE_INCLUDE_DIR})
ENDIF(WIN32)
@@ -83,22 +76,29 @@ SET(CLUCENE_GOOD_VERSION TRUE)
FIND_PATH(CLUCENE_LIBRARY_DIR
NAMES CLucene/clucene-config.h PATHS ${TRIAL_LIBRARY_PATHS} ${TRIAL_INCLUDE_PATHS} NO_DEFAULT_PATH)
IF (CLUCENE_LIBRARY_DIR)
- MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
+ SET(CLUCENE_INCLUDE_DIR ${CLUCENE_INCLUDE_DIR} ${CLUCENE_LIBRARY_DIR})
+ #MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
FILE(READ ${CLUCENE_LIBRARY_DIR}/CLucene/clucene-config.h CLCONTENT)
STRING(REGEX MATCH "_CL_VERSION +\".*\"" CLMATCH ${CLCONTENT})
IF (CLMATCH)
STRING(REGEX REPLACE "_CL_VERSION +\"(.*)\"" "\\1" CLUCENE_VERSION ${CLMATCH})
- IF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}")
- MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum ${CLUCENE_MIN_VERSION}")
+ IF (CLUCENE_VERSION VERSION_LESS "${CLUCENE_MIN_VERSION}")
+ MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum ${CLUCENE_MIN_VERSION}")
SET(CLUCENE_GOOD_VERSION FALSE)
- ENDIF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}")
- IF (CLUCENE_VERSION STREQUAL "0.9.17")
- MESSAGE(ERROR "CLucene version 0.9.17 is not supported.")
+ ENDIF (CLUCENE_VERSION VERSION_LESS "${CLUCENE_MIN_VERSION}")
+ IF (CLUCENE_VERSION STREQUAL "0.9.17")
+ MESSAGE(ERROR "CLucene version 0.9.17 is not supported.")
SET(CLUCENE_GOOD_VERSION FALSE)
- ENDIF (CLUCENE_VERSION STREQUAL "0.9.17")
+ ENDIF (CLUCENE_VERSION STREQUAL "0.9.17")
+ IF (CLUCENE_VERSION VERSION_GREATER "2.0")
+ MESSAGE (STATUS "Found CLucene 2, enabling compatibility mode")
+ SET(CLUCENE2 TRUE)
+ ELSE (CLUCENE_VERSION VERSION_GREATER "2.0")
+ SET(CLUCENE2 FALSE)
+ ENDIF (CLUCENE_VERSION VERSION_GREATER "2.0")
ENDIF (CLMATCH)
ELSE (CLUCENE_LIBRARY_DIR)
- MESSAGE(STATUS "CLucene library dir not found.")
+ #MESSAGE(STATUS "CLucene library dir not found.")
ENDIF (CLUCENE_LIBRARY_DIR)
IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
@@ -107,11 +107,11 @@ ENDIF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCEN
IF(CLucene_FOUND)
IF(NOT CLucene_FIND_QUIETLY)
- MESSAGE(STATUS "Found CLucene: ${CLUCENE_LIBRARY}")
+ MESSAGE(STATUS "CLucene: Yes ${CLUCENE_LIBRARY}")
ENDIF(NOT CLucene_FIND_QUIETLY)
ELSE(CLucene_FOUND)
IF(CLucene_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Could not find CLucene.")
+ MESSAGE(FATAL_ERROR "CLucene: No")
ENDIF(CLucene_FIND_REQUIRED)
ENDIF(CLucene_FOUND)