CMakeLists.txt
3.11 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
PROJECT(MorphAnalyser)
cmake_minimum_required(VERSION 2.8.0)
set(maca_ver_major "1")
set(maca_ver_minor "0")
set(maca_ver_patch "7")
set(BUILD_GPL_PLUGINS OFF CACHE BOOL "Include GPL plugins into installation")
# 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)
set(MACA_BUILD_SWIG True CACHE BOOL "Build SWIG Python wrappers" FORCE)
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)
set(LIBS "")
include_directories(${MorphAnalyser_SOURCE_DIR})
FIND_PATH(LIBMACA_SRC_DATA_DIR
test.ini
${CMAKE_SOURCE_DIR}/data
)
MARK_AS_ADVANCED(LIBMACA_SRC_DATA_DIR)
find_package(Boost 1.41 REQUIRED COMPONENTS program_options filesystem system regex thread)
add_subdirectory(libmaca)
add_subdirectory(maca-analyse)
add_subdirectory(maca-reanalyse)
add_subdirectory(maca-convert)
if(UNIX)
add_subdirectory(tests)
endif()
if(MACA_BUILD_SWIG)
FIND_PACKAGE(SWIG)
if(SWIG_FOUND)
message(STATUS "SWIG found, Python wrappers will be built")
add_subdirectory(swig)
else()
message(STATUS "WARNING: SWIG not found, Python wrappers will not be built")
endif(SWIG_FOUND)
else()
message(STATUS "Not building SWIG Python wrappers")
endif(MACA_BUILD_SWIG)
if (UNIX)
install(FILES tools/bash_completion_maca DESTINATION /etc/bash_completion.d)
endif(UNIX)
message(STATUS "*****************************************************")
if(BUILD_GPL_PLUGINS)
message(STATUS "GPL components have been included into installtion:")
if(SFST_COMPONENT_BUILD)
message(STATUS "\tSFST")
endif(SFST_COMPONENT_BUILD)
if(GUESSER_COMPONENT_BUILD)
message(STATUS "\tGuesser")
endif(GUESSER_COMPONENT_BUILD)
else(BUILD_GPL_PLUGINS)
message(STATUS "No GPL components have been included into installation.")
endif(BUILD_GPL_PLUGINS)
message(STATUS "Use cmake wizard mode: -i; to manage build configuration.")
message(STATUS "*****************************************************")