summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 06d820613f3a129cceb27b04d4337165133c5c5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 2.8)
project(cdec)

add_definitions(-DKENLM_MAX_ORDER=6 -DHAVE_CONFIG_H)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -O3")
set(METEOR_JAR "" CACHE FILEPATH "Path to meteor.jar")

enable_testing()
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

# core packages
find_package(LibDL REQUIRED)
find_package(Boost COMPONENTS regex filesystem serialization program_options unit_test_framework system thread REQUIRED)
include_directories(${Boost_INCLUDE_DIR})

# eigen, used in some modeling extensions
find_package(Eigen3)
if(EIGEN3_FOUND)
  include_directories(${EIGEN3_INCLUDE_DIR})
  set(HAVE_EIGEN 1)
endif(EIGEN3_FOUND)

# compression packages (primarily used by KenLM)
find_package(ZLIB REQUIRED)
if(ZLIB_FOUND)
  set(HAVE_ZLIB 1)
endif(ZLIB_FOUND)
find_package(BZip2)
if(BZIP2_FOUND)
  set(HAVE_BZLIB 1)
endif(BZIP2_FOUND)
find_package(LibLZMA)
if(LIBLZMA_FOUND)
  set(HAVE_XZLIB 1)
endif(LIBLZMA_FOUND)

# for pycdec
find_package(PythonInterp 2.7 REQUIRED)

# generate config.h
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

add_subdirectory(utils)
add_subdirectory(klm/util/double-conversion)
add_subdirectory(klm/util)
add_subdirectory(klm/util/stream)
add_subdirectory(klm/lm)
add_subdirectory(klm/lm/builder)
add_subdirectory(klm/search)
add_subdirectory(mteval)
add_subdirectory(decoder)
add_subdirectory(training)
add_subdirectory(word-aligner)
add_subdirectory(extractor)
add_subdirectory(example_extff)

set(CPACK_PACKAGE_VERSION_MAJOR "2015")
set(CPACK_PACKAGE_VERSION_MINOR "04")
set(CPACK_PACKAGE_VERSION_PATCH "26")
set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
  "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_IGNORE_FILES
  "/.git/;/.gitignore;/Testing/;/build/;/.bzr/;~$;/CMakeCache.txt;/CMakeFiles/;${CPACK_SOURCE_IGNORE_FILES}")
include(CPack)