forked from srndic/hidost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
89 lines (82 loc) · 3.02 KB
/
CMakeLists.txt
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
# Copyright 2012 Nedim Srndic, University of Tuebingen
#
# This file is part of Hidost.
#
# Hidost is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Hidost 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Hidost. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 2.8)
project(hidost)
set(HIDOST_VERSION "1.0")
# A macro to unset names
macro(unset_full)
foreach(MYVAR ${ARGN})
unset(${MYVAR} CACHE)
unset(${MYVAR})
endforeach()
endmacro(unset_full)
# Unset all names
unset_full(CACHER FEAT_EXTRACT FEAT_SELECT MERGER PATHCOUNT PDF2PATHS PDF2VALS)
# Set executable names
set(CACHER_EXECUTABLE_NAME cacher)
set(FEATEXTRACT_EXECUTABLE_NAME feat-extract)
set(FEATSELECT_EXECUTABLE_NAME feat-select)
set(MERGER_EXECUTABLE_NAME merger)
set(PATHCOUNT_EXECUTABLE_NAME pathcount)
set(PDF2PATHS_EXECUTABLE_NAME pdf2paths)
set(PDF2VALS_EXECUTABLE_NAME pdf2vals)
# Make sure the tools to be built are all defined
# Run with -DTOOLSET='tool1;tool2' to select individual tools
if (TOOLSET)
foreach(TOOL ${TOOLSET})
if (TOOL STREQUAL ${CACHER_EXECUTABLE_NAME})
set(CACHER 1)
set(PDF2PATHS 1) # required
set(PDF2VALS 1) # required
elseif (TOOL STREQUAL ${FEATEXTRACT_EXECUTABLE_NAME})
set(FEATEXTRACT 1)
elseif (TOOL STREQUAL ${FEATSELECT_EXECUTABLE_NAME})
set(FEATSELECT 1)
elseif (TOOL STREQUAL ${MERGER_EXECUTABLE_NAME})
set(MERGER 1)
elseif (TOOL STREQUAL ${PATHCOUNT_EXECUTABLE_NAME})
set(PATHCOUNT 1)
set(MERGER 1) # required
elseif (TOOL STREQUAL ${PDF2PATHS_EXECUTABLE_NAME})
set(PDF2PATHS 1)
elseif (TOOL STREQUAL ${PDF2VALS_EXECUTABLE_NAME})
set(PDF2VALS 1)
else (TOOL STREQUAL ${CACHER_EXECUTABLE_NAME})
message(FATAL_ERROR "Unknown tool '${TOOL}'")
endif (TOOL STREQUAL ${CACHER_EXECUTABLE_NAME})
message(STATUS "Preparing to build tool '${TOOL}'")
endforeach(TOOL)
unset_full(TOOLSET)
else (TOOLSET)
message(STATUS "Toolset not defined. Will make all tools.")
set(CACHER 1)
set(FEATEXTRACT 1)
set(FEATSELECT 1)
set(MERGER 1)
set(PATHCOUNT 1)
set(PDF2PATHS 1)
set(PDF2VALS 1)
endif (TOOLSET)
# Set default compile flags for GCC
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wformat=2 -Wall -Wextra -std=c++0x")
endif(CMAKE_COMPILER_IS_GNUCXX)
# C++ source directory
add_subdirectory(src)
# Python/Java source directory
add_subdirectory(hidost)