Newer
Older
ilor
committed
########## libwccl ###############
PROJECT(wccl)
configure_file(version.in include/libwccl/version.h)
ilor
committed
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/include/ )
ilor
committed
find_package(Corpus2 1.0.12 REQUIRED)
set(LIBS ${LIBS} ${Corpus2_LIBRARIES})
ilor
committed
find_package(PwrUtils 1.0.1 REQUIRED)
ilor
committed
set(LIBS ${LIBS} ${PwrUtils_LIBRARY})
ilor
committed
link_directories(${Boost_LIBRARY_DIRS})
set(LIBS ${LIBS} ${Boost_LIBRARIES})
find_package(ICU REQUIRED)
include_directories(${ICU_INCLUDE_DIR})
set(LIBS ${LIBS} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
find_package(ANTLR REQUIRED)
include_directories(${ANTLR_INCLUDE_DIR})
Adam Wardyński
committed
if(WIN32)
Adam Wardynski
committed
# On UNIX this should be included only in final executables
Adam Wardyński
committed
set(LIBS ${LIBS} ${ANTLR_LIBRARY})
endif(WIN32)
ilor
committed
SET(libwccl_STAT_SRC
ops/formatters.cpp
ops/functions/bool/iterations/atleast.cpp
ops/functions/bool/iterations/leftlook.cpp
ops/functions/bool/iterations/only.cpp
ops/functions/bool/iterations/rightlook.cpp
ops/functions/bool/predicate.cpp
ops/functions/bool/predicates/ambiguous.cpp
ops/functions/bool/predicates/and.cpp
ilor
committed
ops/functions/bool/predicates/debug.cpp
ops/functions/bool/predicates/isinside.cpp
ops/functions/bool/predicates/isoutside.cpp
ops/functions/bool/predicates/issingular.cpp
ops/functions/bool/predicates/logicalpredicate.cpp
ops/functions/bool/predicates/nor.cpp
ops/functions/bool/predicates/or.cpp
ops/functions/bool/predicates/pointagreement.cpp
ops/functions/bool/predicates/regex.cpp
ops/functions/bool/predicates/strongagreement.cpp
ops/functions/bool/predicates/weakagreement.cpp
ops/functions/match/submatch.cpp
ops/functions/position/firsttoken.cpp
ops/functions/position/lasttoken.cpp
ops/functions/position/relativeposition.cpp
ops/functions/strset/affix.cpp
ops/functions/strset/getlemmas.cpp
ops/functions/strset/getorth.cpp
ops/functions/strset/lextranslator.cpp
ops/functions/strset/tolower.cpp
ops/functions/strset/toupper.cpp
Adam Radziszewski
committed
ops/functions/strset/anninter.cpp
ops/functions/tset/agrfilter.cpp
ops/functions/tset/catfilter.cpp
ops/functions/tset/getsymbols.cpp
ops/functions/tset/getsymbolsinrange.cpp
ops/match/actions/markbase.cpp
ops/match/actions/overwritematch.cpp
Adam Wardynski
committed
ops/match/conditions/conjconditions.cpp
ops/match/conditions/isannotatedas.cpp
ops/match/conditions/longest.cpp
ops/match/conditions/matchtext.cpp
ops/match/conditions/oneof.cpp
ops/match/conditions/optionalmatch.cpp
ops/match/conditions/repeatedmatch.cpp
Adam Wardynski
committed
ops/match/conditions/tokencondition.cpp
ops/matchrulesequence.cpp
ops/tagactions/mark.cpp
ops/tagactions/relabel.cpp
ops/tagactions/select.cpp
ops/tagactions/unify.cpp
ops/tagactions/unmark.cpp
ops/tagrulesequence.cpp
ilor
committed
sentencecontext.cpp
values/annotationmatch.cpp
values/match.cpp
values/matchvector.cpp
values/tokenmatch.cpp
ilor
committed
variables.cpp
ilor
committed
)
${PROJECT_BINARY_DIR}/parser/ANTLRLexer.cpp
${PROJECT_BINARY_DIR}/parser/ANTLRParser.cpp
${PROJECT_BINARY_DIR}/lexicon/ANTLRLexiconLexer.cpp
${PROJECT_BINARY_DIR}/lexicon/ANTLRLexiconParser.cpp
include_directories(${PROJECT_BINARY_DIR}/parser)
OUTPUT ${PROJECT_BINARY_DIR}/parser/ANTLRLexer.cpp
${PROJECT_BINARY_DIR}/parser/ANTLRLexer.hpp
${PROJECT_BINARY_DIR}/parser/ANTLRParser.cpp
${PROJECT_BINARY_DIR}/parser/ANTLRParser.hpp
${PROJECT_BINARY_DIR}/parser/ANTLRExprTokenTypes.hpp
${PROJECT_BINARY_DIR}/parser/ANTLRExprTokenTypes.txt
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_BINARY_DIR}/parser
COMMAND runantlr -o parser ${PROJECT_SOURCE_DIR}/parser/grammar.g
DEPENDS ${PROJECT_SOURCE_DIR}/parser/grammar.g
COMMENT "-- Generating ANTLR parser cpp/hpp/txt files for WCCL ---")
include_directories(${PROJECT_BINARY_DIR}/lexicon)
ADD_CUSTOM_COMMAND(
OUTPUT
${PROJECT_BINARY_DIR}/lexicon/ANTLRLexiconLexer.cpp
${PROJECT_BINARY_DIR}/lexicon/ANTLRLexiconLexer.hpp
${PROJECT_BINARY_DIR}/lexicon/ANTLRLexiconParser.cpp
${PROJECT_BINARY_DIR}/lexicon/ANTLRLexiconParser.hpp
${PROJECT_BINARY_DIR}/lexicon/ANTLRLexiconsTokenTypes.hpp
${PROJECT_BINARY_DIR}/lexicon/ANTLRLexiconsTokenTypes.txt
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_BINARY_DIR}/lexicon
COMMAND runantlr -o lexicon ${PROJECT_SOURCE_DIR}/lexicon/lexfilegrammar.g
DEPENDS ${PROJECT_SOURCE_DIR}/lexicon/lexfilegrammar.g
COMMENT "-- Generating ANTLR parser cpp/hpp/txt files for lexicon files ---")
ilor
committed
file(GLOB_RECURSE INCS "*.h")
Adam Wardynski
committed
if(WIN32)
#need to explicitly specify exports/external API for win DLL
#until that's done, build STATIC for WIN32
add_library(wccl STATIC ${libwccl_STAT_SRC} ${INCS})
else(WIN32)
add_library(wccl SHARED ${libwccl_STAT_SRC} ${INCS})
endif(WIN32)
ilor
committed
set_target_properties(wccl PROPERTIES
VERSION "${wccl_ver_major}.${wccl_ver_minor}"
SOVERSION ${wccl_ver_major})
ilor
committed
if(UNIX)
install(TARGETS wccl
LIBRARY DESTINATION lib
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION include
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
PATTERN "bin" EXCLUDE
PATTERN "build" EXCLUDE
PATTERN "CMake*" EXCLUDE
)
endif(UNIX)