concordia-library/concordia/CMakeLists.txt
2015-06-25 10:12:51 +02:00

97 lines
2.5 KiB
CMake

set(ALL_DIRECTORIES common)
foreach(dir ${ALL_DIRECTORIES})
link_directories("${concordia_BINARY_DIR}/${dir}")
add_subdirectory(${dir})
endforeach(dir)
add_library(concordia SHARED
token_annotation.cpp
tokenized_sentence.cpp
hashed_sentence.cpp
concordia_search_result.cpp
matched_pattern_fragment.cpp
concordia_searcher.cpp
regex_rule.cpp
sentence_tokenizer.cpp
interval.cpp
tm_matches.cpp
anubis_search_result.cpp
substring_occurence.cpp
example.cpp
index_searcher.cpp
concordia_index.cpp
word_map.cpp
hash_generator.cpp
concordia.cpp
concordia_config.cpp
concordia_exception.cpp
common/logging.cpp
common/utils.cpp
common/text_utils.cpp
)
add_subdirectory(t)
# =====================================
install(TARGETS concordia DESTINATION lib/)
install(FILES
token_annotation.hpp
tokenized_sentence.hpp
hashed_sentence.hpp
concordia_search_result.hpp
matched_pattern_fragment.hpp
concordia_searcher.hpp
regex_rule.hpp
sentence_tokenizer.hpp
interval.hpp
tm_matches.hpp
anubis_search_result.hpp
substring_occurence.hpp
example.hpp
index_searcher.hpp
concordia_index.hpp
word_map.hpp
hash_generator.hpp
concordia.hpp
concordia_config.hpp
concordia_exception.hpp
DESTINATION include/concordia/)
install(FILES
common/config.hpp
common/logging.hpp
common/utils.hpp
common/text_utils.hpp
DESTINATION include/concordia/common/)
# ----------------------------------------------------
# libconfig
# ----------------------------------------------------
find_library(LIBCONFIG_LIB NAMES config++ REQUIRED)
find_path(LIBCONFIG_INCLUDE libconfig.h++)
if(EXISTS ${LIBCONFIG_LIB} AND EXISTS ${LIBCONFIG_INCLUDE})
message(STATUS "Found Libconfig")
include_directories(${LIBCONFIG_INCLUDE})
link_directories(${LIBCONFIG_LIB})
endif(EXISTS ${LIBCONFIG_LIB} AND EXISTS ${LIBCONFIG_INCLUDE})
target_link_libraries(concordia config++)
target_link_libraries(concordia log4cpp)
target_link_libraries(concordia ${Boost_LIBRARIES})
target_link_libraries(concordia divsufsort)
target_link_libraries(concordia utf8case)
if (WITH_RE2)
target_link_libraries(concordia re2)
if (WITH_PCRE)
target_link_libraries(concordia pcrecpp)
endif(WITH_PCRE)
else(WITH_RE2)
if (WITH_PCRE)
target_link_libraries(concordia pcrecpp)
endif(WITH_PCRE)
endif(WITH_RE2)