-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
158 lines (125 loc) · 8.42 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
cmake_minimum_required(VERSION 3.5)
project(textpressocentral)
set(TPC_VERSION "v1.0.0")
set(TPC_RELEASE_NAME "White Snowberry")
add_definitions( -DTPC_VERSION=\"${TPC_VERSION}\" -DTPC_RELEASE_NAME=\"${TPC_RELEASE_NAME}\")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required...
set(CMAKE_CXX_FLAGS "-DBOOST_NO_CXX11_SCOPED_ENUMS -w")
set(CMAKE_STATIC_LIBRARY_PREFIX "") # avoid the prefix "lib"
set(CMAKE_SHARED_LIBRARY_PREFIX "")
SET(CMAKE_INSTALL_PREFIX /usr/local/textpresso)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:/usr/local/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
find_package(APR REQUIRED)
include_directories(${APR_INCLUDE_DIR})
find_package(ImageMagick COMPONENTS Magick++)
include_directories(${ImageMagick_INCLUDE_DIRS})
find_package(CImg REQUIRED)
include_directories(${CImg_INCLUDE_DIRS})
find_package(Lucene++ REQUIRED)
include_directories(${Lucene++_INCLUDE_DIRS})
find_package(Wt REQUIRED)
include_directories(${Wt_INCLUDE_DIR})
find_package(Textpresso REQUIRED)
include_directories(${Textpresso_INCLUDE_DIR})
include_directories("/home/valerio/workspace/caltech/textpresso/libtpc")
#### Main projects ####
add_executable(pdf2tpcas Pdf2Tpcas/main.cpp Pdf2Tpcas/PdfInfo.h Pdf2Tpcas/PdfInfo.cpp Pdf2Tpcas/ElementCluster.h
Pdf2Tpcas/ElementCluster.cpp Pdf2Tpcas/PdfMyFontInfo.h Pdf2Tpcas/PdfMyFontInfo.cpp Pdf2Tpcas/Stream2Tpcas.h
Pdf2Tpcas/Stream2Tpcas.cpp Pdf2Tpcas/TextElement.h Pdf2Tpcas/TextElement.cpp
TextpressoCentralGlobalDefinitions.h TextpressoCentralGlobals.h)
target_link_libraries(pdf2tpcas lucene++ boost_system boost_filesystem podofo fontconfig freetype pthread z jpeg uima icuuc boost_regex
${CImg_SYSTEM_LIBS})
add_executable(createlistofontologies CreateListofOntologies/main.cpp)
target_link_libraries(createlistofontologies pqxx)
add_library(libcrfsgd SHARED crfsgd/assert.h crfsgd/crfsgd.cpp crfsgd/crfsgd.h crfsgd/gzstream.h crfsgd/gzstream.cpp
crfsgd/matrices.h crfsgd/matrices.cpp crfsgd/pstream.h crfsgd/pstream.cpp crfsgd/timer.h
crfsgd/timer.cpp crfsgd/vectors.h crfsgd/vectors.cpp crfsgd/wrapper.h)
add_library(libcrfasgd SHARED crfasgd/assert.h crfasgd/crfasgd.cpp crfasgd/crfasgd.h crfasgd/gzstream.h crfasgd/gzstream.cpp
crfasgd/matrices.h crfasgd/matrices.cpp crfasgd/pstream.h crfasgd/pstream.cpp crfasgd/timer.h
crfasgd/timer.cpp crfasgd/vectors.h crfasgd/vectors.cpp crfasgd/wrapper.h)
add_executable(generatelexicalvariations GenerateLexicalVariations/main.cpp
GenerateLexicalVariations/LexicalVariations.h GenerateLexicalVariations/LexicalVariations.cpp
GenerateLexicalVariations/TpOntApi.h GenerateLexicalVariations/TpOntApi.cpp
GenerateLexicalVariations/TpOntEntry.h GenerateLexicalVariations/TpOntEntry.cpp
GenerateLexicalVariations/tree.h)
target_link_libraries(generatelexicalvariations boost_system boost_filesystem pqxx)
add_executable(lexicalvariations LexicalVariations/main.cpp LexicalVariations/LexicalVariations.h
LexicalVariations/LexicalVariations.cpp)
add_executable(obofileanalyzer OboFileAnalyzer/main.cpp OboFileAnalyzer/OboEntry.cpp OboFileAnalyzer/OboEntry.h
OboFileAnalyzer/OboFileSegmentation.h OboFileAnalyzer/OboFileSegmentation.cpp)
# main web application - tpc
file(GLOB TpC_SRC "TpC/*.h" "TpC/*.cpp" "TpC/*.C" "TpC/*.hpp" "TpC/lucene/CaseSensitiveAnalyzer.h"
"TpC/lucene/CaseSensitiveAnalyzer.cpp")
add_executable(tpc ${TpC_SRC})
set_target_properties(tpc PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
IF(CMAKE_BUILD_TYPE MATCHES Debug)
target_link_libraries(tpc uima ${Wt_LIBRARIES} ${Wt_HTTP_LIBRARY} curl
boost_system boost_filesystem icuuc xerces-c
boost_thread boost_regex pthread pqxx lucene++ boost_iostreams ${CImg_SYSTEM_LIBS} ${Textpresso_LIBRARY}
boost_serialization)
ELSE(CMAKE_BUILD_TYPE MATCHES Debug)
target_link_libraries(tpc uima ${Wt_LIBRARIES} ${Wt_FCGI_LIBRARY} curl
boost_system boost_filesystem icuuc xerces-c boost_thread boost_regex pthread pqxx lucene++ boost_iostreams
${CImg_SYSTEM_LIBS} ${Textpresso_LIBRARY} boost_serialization)
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
add_executable(tpcuration TpCuration/main.cpp TpCuration/TextpressoCentralGlobalDefinitions.h TpCuration/TpCurApi.h
TpCuration/TpCurApi.cpp)
target_link_libraries(tpcuration pqxx)
add_executable(tpflat2oboconverter TpFlat2OboConverter/main.cpp)
add_executable(tpontology TpOntology/main.cpp TpOntology/TpOntApi.h TpOntology/TpOntApi.cpp TpOntology/TpOntEntry.h
TpOntology/TpOntEntry.cpp TpOntology/tree.h)
target_link_libraries(tpontology pqxx boost_filesystem boost_system)
add_executable(xml2tpcas Xml2Tpcas/main.cpp Xml2Tpcas/pugiconfig.hpp Xml2Tpcas/pugixml.hpp Xml2Tpcas/pugixml.cpp
Xml2Tpcas/PugiXml2Tpcas.h Xml2Tpcas/PugiXml2Tpcas.cpp Xml2Tpcas/ReadXml2Stream.h Xml2Tpcas/ReadXml2Stream.cpp
Xml2Tpcas/Stream2Tpcas.cpp Xml2Tpcas/Stream2Tpcas.h)
target_link_libraries(xml2tpcas uima icuuc boost_system boost_filesystem)
#### Subprojects ####
# create textpresso directory structure locally - skip bin and lib
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/resources)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/resources/resources-tpc)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/resources/resources-web)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/cronjobs)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/luceneindex)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/tpontology)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/useful)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/useruploads)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/html)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/tpcas)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/etc)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/conf)
#### INSTALL ####
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/resources DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/cronjobs DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/luceneindex DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/tpontology DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/useful DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/etc DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/useruploads DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/html DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/tpcas DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/etc DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dirs/conf DESTINATION ${CMAKE_INSTALL_PREFIX})
install(TARGETS generatelexicalvariations
obofileanalyzer pdf2tpcas tpc tpflat2oboconverter tpontology xml2tpcas
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
install(FILES tpctl.sh DESTINATION bin PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
SET(CMAKE_INSTALL_PREFIX /usr/local/textpresso)
install(FILES etc/template.bib DESTINATION etc)
install(FILES LexicalVariations/resources/allverbs.txt TpC/resources/authstrings.xml TpC/resources/authtemplates.xml
TpC/resources/curation-form.xml TpC/resources/home.contactus.txt TpC/resources/home.firststeps.txt
TpC/resources/home.introduction.txt TpC/resources/home.news.txt LexicalVariations/resources/irrplurals.txt
LexicalVariations/resources/irrverbs.txt TpC/resources/TpC.css TpC/resources/TpC.xml
TpC/resources/uploadtemplate.tsv TpC/resources/TpCentral.css TpC/resources/TpCentral.xml
TpC/resources/customize-colors.xml
DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/resources-tpc)
install(DIRECTORY TpC/resources/icons DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/resources-tpc)
install(DIRECTORY TpC/resources/other_images DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/resources-tpc)
install(FILES ConfigurationFiles/wt_config.xml ConfigurationFiles/wt_config_debug.xml ConfigurationFiles/fastcgi.conf
DESTINATION ${CMAKE_INSTALL_PREFIX}/conf)
SET(CMAKE_INSTALL_PREFIX /usr/local)