Skip to content
Snippets Groups Projects
Commit 22e89701 authored by Maciej Zawadzki's avatar Maciej Zawadzki
Browse files

init version for public use

parents
Branches
No related tags found
No related merge requests found
Showing
with 876 additions and 0 deletions
PROJECT(Tokenizer)
cmake_minimum_required(VERSION 2.6.0)
# use some of our own Find* scripts
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeScripts)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release
RelWithDebInfo MinSizeRel."
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
if(CMAKE_COMPILER_IS_GNUCXX)
# Set our own default flags at first run.
if(NOT CONFIGURED)
if(ENABLE_STRICT_COMPILATION)
set(STRICT_FLAGS "-Werror -Wno-unused-parameter")
else(ENABLE_STRICT_COMPILATION)
set(STRICT_FLAGS "")
endif(ENABLE_STRICT_COMPILATION)
set(CMAKE_C_FLAGS "-W -Wall -ansi $ENV{CFLAGS}"
CACHE STRING "Flags used by the C compiler during normal builds."
FORCE)
set(CMAKE_C_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 -W -Wall -ansi $ENV{CFLAGS}"
CACHE STRING "Flags used by the C compiler during debug builds."
FORCE)
set(CMAKE_CXX_FLAGS "-W -Wall -ansi ${STRICT_FLAGS} $ENV{CXXFLAGS}"
CACHE STRING "Flags used by the CXX compiler during normal builds."
FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 -W -Wall -ansi ${STRICT_FLAGS} $ENV{CXXFLAGS}"
CACHE STRING "Flags used by the CXX compiler during debug builds."
FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -fno-omit-frame-pointer"
CACHE STRING "Flags used by the CXX compiler during relwithdebiginfo builds" FORCE)
endif(NOT CONFIGURED)
endif(CMAKE_COMPILER_IS_GNUCXX)
find_package(Boost 1.41 REQUIRED COMPONENTS program_options filesystem system regex)
add_subdirectory(libtoki)
if(UNIX)
add_subdirectory(tests)
endif(UNIX)
add_subdirectory(toki-app)
FIND_PATH(Corpus2_INCLUDE_DIR token.h /usr/include/libcorpus2 /usr/local/include/libcorpus2 )
FIND_LIBRARY(Corpus2_LIBRARY NAMES corpus2 PATH /usr/lib /usr/local/lib)
MARK_AS_ADVANCED(Corpus2_LIBRARY)
MARK_AS_ADVANCED(Corpus2_INCLUDE_DIR)
IF (Corpus2_INCLUDE_DIR AND Corpus2_LIBRARY)
SET(Corpus2_FOUND TRUE)
ENDIF (Corpus2_INCLUDE_DIR AND Corpus2_LIBRARY)
IF (Corpus2_FOUND)
set(Corpus2_VERSION 0.0.0)
FIND_FILE(_Corpus2_VERSION_FILE version.h ${Corpus2_INCLUDE_DIR})
MARK_AS_ADVANCED(_Corpus2_VERSION_FILE)
IF (_Corpus2_VERSION_FILE)
FILE(READ ${_Corpus2_VERSION_FILE} _Corpus2_VERSION_CONENTS)
STRING(REGEX REPLACE ".*#define LIBCORPUS2_VERSION \\\"([0-9.]+)\\\".*" "\\1" Corpus2_VERSION "${_Corpus2_VERSION_CONENTS}")
ENDIF (_Corpus2_VERSION_FILE)
IF (Corpus2_FIND_VERSION)
IF (Corpus2_VERSION VERSION_LESS Corpus2_FIND_VERSION)
IF (Corpus2_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Corpus2 version too old: ${Corpus2_VERSION}, requested >= ${Corpus2_FIND_VERSION}")
ELSE (Corpus2_FIND_REQUIRED)
IF (NOT Corpus2_FIND_QUIETLY)
MESSAGE(STATUS "Corpus2 version too old: ${Corpus2_VERSION}, requested >= ${Corpus2_FIND_VERSION}")
ENDIF (NOT Corpus2_FIND_QUIETLY)
ENDIF (Corpus2_FIND_REQUIRED)
set(Corpus2_FOUND False)
ENDIF (Corpus2_VERSION VERSION_LESS Corpus2_FIND_VERSION)
ENDIF (Corpus2_FIND_VERSION)
IF (NOT Corpus2_FIND_QUIETLY)
MESSAGE(STATUS "Found libcorpus2 ${Corpus2_VERSION}: ${Corpus2_LIBRARY}")
ENDIF (NOT Corpus2_FIND_QUIETLY)
ELSE (Corpus2_FOUND)
IF (Corpus2_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find libcorpus2")
ELSE (Corpus2_FIND_REQUIRED)
MESSAGE(STATUS "libcorpus2 not found")
ENDIF (Corpus2_FIND_REQUIRED)
ENDIF (Corpus2_FOUND)
# - Try to find Glib-2.0 (with gobject)
# Once done, this will define
#
# Glib_FOUND - system has Glib
# Glib_INCLUDE_DIRS - the Glib include directories
# Glib_LIBRARIES - link these to use Glib
include(LibFindMacros)
# Use pkg-config to get hints about paths
libfind_pkg_check_modules(Glib_PKGCONF glib-2.0)
# Main include dir
find_path(Glib_INCLUDE_DIR
NAMES glib.h
PATHS ${Glib_PKGCONF_INCLUDE_DIRS}
PATH_SUFFIXES glib-2.0
)
# Glib-related libraries also use a separate config header, which is in lib dir
find_path(GlibConfig_INCLUDE_DIR
NAMES glibconfig.h
PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr
PATH_SUFFIXES lib/glib-2.0/include
)
# Finally the library itself
find_library(Glib_LIBRARY
NAMES glib-2.0
PATHS ${Glib_PKGCONF_LIBRARY_DIRS}
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR)
set(Glib_PROCESS_LIBS Glib_LIBRARY)
libfind_process(Glib)
# - Try to find Glibmm-2.4
# Once done, this will define
#
# Glibmm_FOUND - system has Glibmm
# Glibmm_INCLUDE_DIRS - the Glibmm include directories
# Glibmm_LIBRARIES - link these to use Glibmm
include(LibFindMacros)
# Dependencies
libfind_package(Glibmm Glib)
libfind_package(Glibmm SigC++)
# Use pkg-config to get hints about paths
libfind_pkg_check_modules(Glibmm_PKGCONF glibmm-2.4)
# Main include dir
find_path(Glibmm_INCLUDE_DIR
NAMES glibmm/main.h
PATHS ${Glibmm_PKGCONF_INCLUDE_DIRS}
PATH_SUFFIXES glibmm-2.4
)
# Glib-related libraries also use a separate config header, which is in lib dir
find_path(GlibmmConfig_INCLUDE_DIR
NAMES glibmmconfig.h
PATHS ${Glibmm_PKGCONF_INCLUDE_DIRS} /usr
PATH_SUFFIXES lib/glibmm-2.4/include
)
libfind_library(Glibmm glibmm 2.4)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(Glibmm_PROCESS_INCLUDES Glibmm_INCLUDE_DIR GlibmmConfig_INCLUDE_DIR Glib_INCLUDE_DIRS SigC++_INCLUDE_DIRS)
set(Glibmm_PROCESS_LIBS Glibmm_LIBRARY Glib_LIBRARIES SigC++_LIBRARIES)
libfind_process(Glibmm)
# Finds the International Components for Unicode (ICU) Library
#
# ICU_FOUND - True if ICU found.
# ICU_I18N_FOUND - True if ICU's internationalization library found.
# ICU_INCLUDE_DIRS - Directory to include to get ICU headers
# Note: always include ICU headers as, e.g.,
# unicode/utypes.h
# ICU_LIBRARIES - Libraries to link against for the common ICU
# ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation
# (note: in addition to ICU_LIBRARIES)
MARK_AS_ADVANCED(ICU_DIR)
# Look for the header file.
find_path(
ICU_INCLUDE_DIR
NAMES unicode/utypes.h
DOC "Include directory for the ICU library")
mark_as_advanced(ICU_INCLUDE_DIR)
# Look for the library.
find_library(
ICU_LIBRARY
NAMES icuuc cygicuuc cygicuuc32
DOC "Libraries to link against for the common parts of ICU")
mark_as_advanced(ICU_LIBRARY)
# Copy the results to the output variables.
if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
set(ICU_FOUND 1)
set(ICU_LIBRARIES ${ICU_LIBRARY})
set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
set(ICU_VERSION 0)
set(ICU_MAJOR_VERSION 0)
set(ICU_MINOR_VERSION 0)
FILE(READ "${ICU_INCLUDE_DIR}/unicode/uversion.h" _ICU_VERSION_CONENTS)
STRING(REGEX REPLACE ".*#define U_ICU_VERSION_MAJOR_NUM ([0-9]+).*" "\\1" ICU_MAJOR_VERSION "${_ICU_VERSION_CONENTS}")
STRING(REGEX REPLACE ".*#define U_ICU_VERSION_MINOR_NUM ([0-9]+).*" "\\1" ICU_MINOR_VERSION "${_ICU_VERSION_CONENTS}")
set(ICU_VERSION "${ICU_MAJOR_VERSION}.${ICU_MINOR_VERSION}")
# Look for the ICU internationalization libraries
find_library(
ICU_I18N_LIBRARY
NAMES icuin icui18n cygicuin cygicuin32
DOC "Libraries to link against for ICU internationalization")
mark_as_advanced(ICU_I18N_LIBRARY)
if (ICU_I18N_LIBRARY)
set(ICU_I18N_FOUND 1)
set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY})
else (ICU_I18N_LIBRARY)
set(ICU_I18N_FOUND 0)
set(ICU_I18N_LIBRARIES)
endif (ICU_I18N_LIBRARY)
else(ICU_INCLUDE_DIR AND ICU_LIBRARY)
set(ICU_FOUND 0)
set(ICU_I18N_FOUND 0)
set(ICU_LIBRARIES)
set(ICU_I18N_LIBRARIES)
set(ICU_INCLUDE_DIRS)
set(ICU_VERSION)
set(ICU_MAJOR_VERSION)
set(ICU_MINOR_VERSION)
endif(ICU_INCLUDE_DIR AND ICU_LIBRARY)
IF(ICU_FOUND)
IF( NOT ICU_FIND_QUIETLY )
MESSAGE( STATUS "Found ICU header files in ${ICU_INCLUDE_DIRS}")
MESSAGE( STATUS "Found ICU libraries: ${ICU_LIBRARIES}")
ENDIF( NOT ICU_FIND_QUIETLY )
ELSE(ICU_FOUND)
IF(ICU_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could not find ICU" )
ELSE(ICU_FIND_REQUIRED)
MESSAGE( STATUS "Optional package ICU was not found" )
ENDIF(ICU_FIND_REQUIRED)
ENDIF(ICU_FOUND)
# - Try to find LibXML++ 2.6
# Once done, this will define
#
# LibXML++_FOUND - system has LibXML++
# LibXML++_INCLUDE_DIRS - the LibXML++ include directories
# LibXML++_LIBRARIES - link these to use LibXML++
include(LibFindMacros)
# Dependencies
libfind_package(LibXML++ LibXML2)
libfind_package(LibXML++ Glibmm)
# Use pkg-config to get hints about paths
libfind_pkg_check_modules(LibXML++_PKGCONF libxml++-2.6)
# Main include dir
find_path(LibXML++_INCLUDE_DIR
NAMES libxml++/libxml++.h
PATHS ${LibXML++_PKGCONF_INCLUDE_DIRS}
PATH_SUFFIXES libxml++-2.6
)
# Glib-related libraries also use a separate config header, which is in lib dir
find_path(LibXML++Config_INCLUDE_DIR
NAMES libxml++config.h
PATHS ${LibXML++_PKGCONF_INCLUDE_DIRS} /usr
PATH_SUFFIXES lib/libxml++-2.6/include
)
# Finally the library itself
find_library(LibXML++_LIBRARY
NAMES xml++-2.6
PATHS ${LibXML++_PKGCONF_LIBRARY_DIRS}
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(LibXML++_PROCESS_INCLUDES LibXML++_INCLUDE_DIR LibXML++Config_INCLUDE_DIR LibXML2_INCLUDE_DIRS Glibmm_INCLUDE_DIRS)
set(LibXML++_PROCESS_LIBS LibXML++_LIBRARY LibXML2_LIBRARIES Glibmm_LIBRARIES)
libfind_process(LibXML++)
# - Try to find libxml2
# Once done this will define
#
# LibXML2_FOUND - system has xml2
# LibXML2_INCLUDE_DIRS - the xml2 include directory
# LibXML2_LIBRARIES - Link these to use xml2
# LibXML2_DEFINITIONS - Compiler switches required for using xml2
#
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
# Modified for other libraries by Lasse Kärkkäinen <tronic>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (LibXML2_LIBRARIES AND LibXML2_INCLUDE_DIRS)
# in cache already
set(LibXML2_FOUND TRUE)
else (LibXML2_LIBRARIES AND LibXML2_INCLUDE_DIRS)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(libxml-2.0 _LibXML2_INCLUDEDIR _LibXML2_LIBDIR _LibXML2_LDFLAGS _LibXML2_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_LIBXML2 libxml-2.0)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(LibXML2_INCLUDE_DIR
NAMES
libxml/xpath.h
PATHS
${_LibXML2_INCLUDEDIR}
/usr/include
/usr/local/include
/opt/local/include
/sw/include
PATH_SUFFIXES
libxml2
)
find_library(LibXML2_LIBRARY
NAMES
xml2
PATHS
${_LibXML2_LIBDIR}
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
if (LibXML2_LIBRARY)
set(LibXML2_FOUND TRUE)
endif (LibXML2_LIBRARY)
set(LibXML2_INCLUDE_DIRS
${LibXML2_INCLUDE_DIR}
)
if (LibXML2_FOUND)
set(LibXML2_LIBRARIES
${LibXML2_LIBRARIES}
${LibXML2_LIBRARY}
)
endif (LibXML2_FOUND)
if (LibXML2_INCLUDE_DIRS AND LibXML2_LIBRARIES)
set(LibXML2_FOUND TRUE)
endif (LibXML2_INCLUDE_DIRS AND LibXML2_LIBRARIES)
if (LibXML2_FOUND)
if (NOT LibXML2_FIND_QUIETLY)
message(STATUS "Found libxml2: ${LibXML2_LIBRARY}")
endif (NOT LibXML2_FIND_QUIETLY)
else (LibXML2_FOUND)
if (LibXML2_FIND_REQUIRED)
message(FATAL_ERROR "Could not find libxml2")
endif (LibXML2_FIND_REQUIRED)
endif (LibXML2_FOUND)
# show the LibXML2_INCLUDE_DIRS and LibXML2_LIBRARIES variables only in the advanced view
mark_as_advanced(LibXML2_INCLUDE_DIRS LibXML2_LIBRARIES)
endif (LibXML2_LIBRARIES AND LibXML2_INCLUDE_DIRS)
FIND_PATH(LOKI_INCLUDE_DIR loki/LokiExport.h /usr/include /usr/local/include)
FIND_LIBRARY(LOKI_LIBRARY NAMES loki PATHS /usr/lib /usr/local/lib)
MARK_AS_ADVANCED(LOKI_LIBRARY)
MARK_AS_ADVANCED(LOKI_INCLUDE_DIR)
IF (LOKI_INCLUDE_DIR AND LOKI_LIBRARY)
SET(LOKI_FOUND TRUE)
ENDIF (LOKI_INCLUDE_DIR AND LOKI_LIBRARY)
IF (LOKI_FOUND)
IF (NOT LOKI_FIND_QUIETLY)
MESSAGE(STATUS "Found LOKI: ${LOKI_LIBRARY}")
ENDIF (NOT LOKI_FIND_QUIETLY)
ELSE (LOKI_FOUND)
IF (Loki_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Loki-lib")
ELSE (Loki_FIND_REQUIRED)
MESSAGE(STATUS "Loki not found")
ENDIF (Loki_FIND_REQUIRED)
ENDIF (LOKI_FOUND)
#FIND_PATH(MORFEUSZ_INCLUDE_DIR morfeusz.h /usr/include /usr/local/include)
#MARK_AS_ADVANCED(MORFEUSZ_INCLUDE_DIR)
FIND_LIBRARY(MORFEUSZ_LIBRARY NAMES morfeusz PATH /usr/lib /usr/local/lib)
MARK_AS_ADVANCED(MORFEUSZ_LIBRARY)
#IF (MORFEUSZ_INCLUDE_DIR AND MORFEUSZ_LIBRARY)
IF (MORFEUSZ_LIBRARY)
SET(MORFEUSZ_FOUND TRUE)
ENDIF (MORFEUSZ_LIBRARY)
IF (MORFEUSZ_FOUND)
IF (NOT Morfeusz_FIND_QUIETLY)
MESSAGE(STATUS "Found Morfeusz: ${MORFEUSZ_LIBRARY}")
ENDIF (NOT Morfeusz_FIND_QUIETLY)
ELSE (MORFEUSZ_FOUND)
IF (Morfeusz_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Morfeusz")
ENDIF (Morfeusz_FIND_REQUIRED)
ENDIF (MORFEUSZ_FOUND)
FIND_PATH(PwrUtils_INCLUDE_DIR libpwrutils/version.h /usr/include /usr/local/include )
FIND_LIBRARY(PwrUtils_LIBRARY NAMES pwrutils PATH /usr/lib /usr/local/lib)
MARK_AS_ADVANCED(PwrUtils_LIBRARY)
MARK_AS_ADVANCED(PwrUtils_INCLUDE_DIR)
IF (PwrUtils_INCLUDE_DIR AND PwrUtils_LIBRARY)
SET(PwrUtils_FOUND TRUE)
ENDIF (PwrUtils_INCLUDE_DIR AND PwrUtils_LIBRARY)
IF (PwrUtils_FOUND)
set(PwrUtils_VERSION 0.0.0)
FIND_FILE(_PwrUtils_VERSION_FILE libpwrutils/version.h ${PwrUtils_INCLUDE_DIR})
MARK_AS_ADVANCED(_PwrUtils_VERSION_FILE)
IF (_PwrUtils_VERSION_FILE)
FILE(READ ${_PwrUtils_VERSION_FILE} _PwrUtils_VERSION_CONENTS)
STRING(REGEX REPLACE ".*#define LIBPWRUTILS_VERSION \\\"([0-9.]+)\\\".*" "\\1" PwrUtils_VERSION "${_PwrUtils_VERSION_CONENTS}")
ENDIF (_PwrUtils_VERSION_FILE)
IF (PwrUtils_FIND_VERSION)
IF (PwrUtils_VERSION VERSION_LESS PwrUtils_FIND_VERSION)
IF (PwrUtils_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "PwrUtils version too old: ${PwrUtils_VERSION}, requested >= ${PwrUtils_FIND_VERSION}")
ELSE (PwrUtils_FIND_REQUIRED)
IF (NOT PwrUtils_FIND_QUIETLY)
MESSAGE(STATUS "PwrUtils version too old: ${PwrUtils_VERSION}, requested >= ${PwrUtils_FIND_VERSION}")
ENDIF (NOT PwrUtils_FIND_QUIETLY)
ENDIF (PwrUtils_FIND_REQUIRED)
set(PwrUtils_FOUND False)
ENDIF (PwrUtils_VERSION VERSION_LESS PwrUtils_FIND_VERSION)
ENDIF (PwrUtils_FIND_VERSION)
IF (NOT PwrUtils_FIND_QUIETLY)
MESSAGE(STATUS "Found libpwrutils ${PwrUtils_VERSION}: ${PwrUtils_LIBRARY}")
ENDIF (NOT PwrUtils_FIND_QUIETLY)
ELSE (PwrUtils_FOUND)
IF (PwrUtils_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find libpwrutils")
ELSE (PwrUtils_FIND_REQUIRED)
MESSAGE(STATUS "libpwrutils not found")
ENDIF (PwrUtils_FIND_REQUIRED)
ENDIF (PwrUtils_FOUND)
# - Try to find SigC++-2.0
# Once done, this will define
#
# SigC++_FOUND - system has SigC++
# SigC++_INCLUDE_DIRS - the SigC++ include directories
# SigC++_LIBRARIES - link these to use SigC++
include(LibFindMacros)
# Use pkg-config to get hints about paths
libfind_pkg_check_modules(SigC++_PKGCONF sigc++-2.0)
# Main include dir
find_path(SigC++_INCLUDE_DIR
NAMES sigc++/sigc++.h
PATHS ${SigC++_PKGCONF_INCLUDE_DIRS}
PATH_SUFFIXES sigc++-2.0
)
# Glib-related libraries also use a separate config header, which is in lib dir
find_path(SigC++Config_INCLUDE_DIR
NAMES sigc++config.h
PATHS ${SigC++_PKGCONF_INCLUDE_DIRS} /usr
PATH_SUFFIXES lib/sigc++-2.0/include
)
libfind_library(SigC++ sigc 2.0)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(SigC++_PROCESS_INCLUDES SigC++_INCLUDE_DIR SigC++Config_INCLUDE_DIR)
set(SigC++_PROCESS_LIBS SigC++_LIBRARY)
libfind_process(SigC++)
# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
# used for the current package. For this to work, the first parameter must be the
# prefix of the current package, then the prefix of the new package etc, which are
# passed to find_package.
macro (libfind_package PREFIX)
set (LIBFIND_PACKAGE_ARGS ${ARGN})
if (${PREFIX}_FIND_QUIETLY)
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
endif (${PREFIX}_FIND_QUIETLY)
if (${PREFIX}_FIND_REQUIRED)
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
endif (${PREFIX}_FIND_REQUIRED)
find_package(${LIBFIND_PACKAGE_ARGS})
endmacro (libfind_package)
# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
# where they added pkg_check_modules. Consequently I need to support both in my scripts
# to avoid those deprecated warnings. Here's a helper that does just that.
# Works identically to pkg_check_modules, except that no checks are needed prior to use.
macro (libfind_pkg_check_modules PREFIX PKGNAME)
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(${PREFIX} ${PKGNAME})
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
endmacro (libfind_pkg_check_modules)
# Do the final processing once the paths have been detected.
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
# all the variables, each of which contain one include directory.
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
# Also handles errors in case library detection was required, etc.
macro (libfind_process PREFIX)
# Skip processing if already processed during this run
if (NOT ${PREFIX}_FOUND)
# Start with the assumption that the library was found
set (${PREFIX}_FOUND TRUE)
# Process all includes and set _FOUND to false if any are missing
foreach (i ${${PREFIX}_PROCESS_INCLUDES})
if (${i})
set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
mark_as_advanced(${i})
else (${i})
set (${PREFIX}_FOUND FALSE)
endif (${i})
endforeach (i)
# Process all libraries and set _FOUND to false if any are missing
foreach (i ${${PREFIX}_PROCESS_LIBS})
if (${i})
set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
mark_as_advanced(${i})
else (${i})
set (${PREFIX}_FOUND FALSE)
endif (${i})
endforeach (i)
# Print message and/or exit on fatal error
if (${PREFIX}_FOUND)
if (NOT ${PREFIX}_FIND_QUIETLY)
message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
endif (NOT ${PREFIX}_FIND_QUIETLY)
else (${PREFIX}_FOUND)
if (${PREFIX}_FIND_REQUIRED)
foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
message("${i}=${${i}}")
endforeach (i)
message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
endif (${PREFIX}_FIND_REQUIRED)
endif (${PREFIX}_FOUND)
endif (NOT ${PREFIX}_FOUND)
endmacro (libfind_process)
macro(libfind_library PREFIX basename)
set(TMP "")
if(MSVC80)
set(TMP -vc80)
endif(MSVC80)
if(MSVC90)
set(TMP -vc90)
endif(MSVC90)
set(${PREFIX}_LIBNAMES ${basename}${TMP})
if(${ARGC} GREATER 2)
set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
endif(${ARGC} GREATER 2)
find_library(${PREFIX}_LIBRARY
NAMES ${${PREFIX}_LIBNAMES}
PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
)
endmacro(libfind_library)
This diff is collapsed.
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
This diff is collapsed.
INSTALL 0 → 100644
To install the library and the test application, you'll need CMake 2.6.
Required libraries:
• ICU 4.2
• Boost 1.41
• Loki
• libxml++2.6 (for SRX support)
• libpwrutils from corpus2 repository, http://nlp.pwr.wroc.pl/corpus2.git
These libraries must be installed along with their headers. If you are using a repository with older versions (provided by your Linux distribution), you may need to uninstall the old versions from the repository and install new from sources.
To install, issue the following:
cmake -i
(or maybe ``CXX=/usr/lib/distcc/g++ CXXFLAGS="-march=i686 -m32" cmake -i'' or similar)
and confirm the proposed default values (when asked for seeing advanced options, confirm No). There should be no errors; if there are any, they probably come from lack of the required libraries. If there are errors and you want to retry the install procedure (having installed the missing libraries), remove the CMakeCache.txt file to make sure CMake hasn't memorised the previous state of your system.
After running CMake successfully, you are ready to proceed with the standard make-and-install procedure:
make
(wait for it to finish, make sure there are no errors)
sudo make install
make test (if you want to run the unit tests)
LICENSE 0 → 100644
Copyright (C) 2010 Tomasz Śniatowski, Adam Radziszewski
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses>.
Additional permission under GNU LGPL version 3 section 7
If you modify this Program, or any covered work, by linking or combining
it with Morfeusz (or a modified version of that library),
containing parts covered by the terms of the Morfeusz license, the
licensors of this Program grant you additional permission to convey the
resulting work.
/*
Copyright (C) 2010 Tomasz Śniatowski, Adam Radziszewski
Part of the libtoki project
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
See the LICENSE and COPYING files for more details.
*/
[input_layer]
buffer=2000
[layer:split]
ignore_types=t_ip
class=split
separators=/!.
sep_tok_type=@
[layer:combine]
class=combine
cutoff=0.1
[layer:append_plus]
class=append
ignore_types=a,b
append=+=\u0009
[layer:append_minus]
class=append
process_types=t
append=-
[layer:affix]
class=affix_split
prefix_chars=(
suffix_chars=")
prefix_tok_type=a
suffix_tok_type=b
[layer:classify]
class=regexp
type:szatan=szatan
type:ogonki=[ążźśćółŁÓĄŻŹŚĆĘęńŃ]*
type:ip=([0-9]{1,3})(.[0-9]{1,3}){3}
[layers]
layer=affix
layer=classify
layer=append_plus
layer=append_minus
[input]
token_type=t
z=split
prof.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment