Skip to content

Commit 40b1b6c

Browse files
committed
make windows workable.
1 parent 9c0d9f1 commit 40b1b6c

12 files changed

+36
-45
lines changed

src/CMakeLists.txt

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
set (util_DIR ${SOURCE_DIR}/__util/)
22
set (utils_DIR ${SOURCE_DIR}/utils)
33
set (xml4nlp_DIR ${SOURCE_DIR}/__xml4nlp/)
4-
#set (crfwordseg_DIR ${SOURCE_DIR}/_crfwordsegment/)
54
set (segmentor_DIR ${SOURCE_DIR}/segmentor)
65
set (postagger_DIR ${SOURCE_DIR}/postagger)
76
set (parser_DIR ${SOURCE_DIR}/parser)
8-
#set (svmtagger_DIR ${SOURCE_DIR}/_svmtagger/)
97
set (splitsnt_DIR ${SOURCE_DIR}/_split_sentence/)
108
set (ner_DIR ${SOURCE_DIR}/_ner/)
11-
#set (gparser_DIR ${SOURCE_DIR}/_gparser)
129
set (srl_DIR ${SOURCE_DIR}/_srl/)
1310
set (ltp_dll_DIR ${SOURCE_DIR}/__ltp_dll/)
14-
15-
set (server_DIR ${SOURCE_DIR}/server/)
11+
set (server_DIR ${SOURCE_DIR}/server/)
1612

1713
add_subdirectory ("__util")
1814
add_subdirectory ("__xml4nlp")
1915
add_subdirectory ("_split_sentence")
2016
add_subdirectory ("segmentor")
2117
add_subdirectory ("postagger")
2218
add_subdirectory ("parser")
23-
#add_subdirectory ("_crfwordsegment")
24-
#add_subdirectory ("_svmtagger")
2519
add_subdirectory ("_ner")
26-
#add_subdirectory ("_gparser")
2720
add_subdirectory ("_srl")
21+
add_subdirectory ("__ltp_dll")
2822

23+
# mongoose server is not supported in windows
24+
if (NOT WIN32)
2925
add_subdirectory ("server")
26+
endif()
3027

31-
add_subdirectory ("__ltp_dll")
3228

33-
#add_subdirectory ("test")

src/__ltp_dll/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ include_directories (./
22
${xml4nlp_DIR}
33
${util_DIR}
44
${utils_DIR}
5-
#${crfwordseg_DIR}
6-
#${svmtagger_DIR}
7-
#${gparser_DIR}
85
${splitsnt_DIR}
96
${segmentor_DIR}
107
${postagger_DIR}

src/__ltp_dll/LTPResource.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#pragma comment(lib, "segmentor.lib")
1515
#pragma comment(lib, "postagger.lib")
1616
#pragma comment(lib, "parser.lib")
17-
#pragma comment(lib, "_ner.lib")
18-
#pragma comment(lib, "_srl.lib")
17+
#pragma comment(lib, "ner.lib")
18+
#pragma comment(lib, "srl.lib")
1919
#endif
2020

2121
#include "logging.hpp"

src/__ltp_dll/Ltp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#pragma comment(lib, "segmentor.lib")
1818
#pragma comment(lib, "postagger.lib")
1919
#pragma comment(lib, "parser.lib")
20-
#pragma comment(lib, "_ner.lib")
21-
#pragma comment(lib, "_srl.lib")
20+
#pragma comment(lib, "ner.lib")
21+
#pragma comment(lib, "srl.lib")
2222
#endif
2323

2424
#include "logging.hpp"

src/_ner/NER_DLL.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define NER_DLL_API_EXPORT
21
#include "NER_DLL.h"
32

43
#include "Model.h"

src/_ner/NER_DLL.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
#define __NER_DLL_H__
33

44
#define NER_DLL_API
5+
#define NER_DLL_API_EXPORT
56

67
#ifdef _WIN32
78
#undef NER_DLL_API
89
#ifdef NER_DLL_API_EXPORT
910
#define NER_DLL_API extern "C" _declspec(dllexport)
1011
#else
1112
#define NER_DLL_API extern "C" _declspec(dllimport)
12-
#pragma comment(lib, "_ner.lib")
13+
#pragma comment(lib, "ner.lib")
1314
#endif
1415
#endif
1516

src/_srl/SRL_DLL.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define SRL_DLL_API_EXPORT
21
#include "SRL_DLL.h"
32
#include "DepSRL.h"
43
#include <vector>

src/_srl/SRL_DLL.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
using namespace std;
1111

1212
#define SRL_DLL_API
13+
#define SRL_DLL_API_EXPORT
1314

1415
#ifdef _WIN32
1516
#undef SRL_DLL_API
1617
#ifdef SRL_DLL_API_EXPORT
1718
#define SRL_DLL_API extern "C" _declspec(dllexport)
1819
#else
1920
#define SRL_DLL_API extern "C" _declspec(dllimport)
20-
#pragma comment(lib, "_srl.lib")
21+
#pragma comment(lib, "srl.lib")
2122
#endif
2223
#endif
2324

src/parser/parser_dll.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifdef _WIN32
1111
#undef PARSER_DLL_API
1212
#ifdef PARSER_DLL_API_EXPORT
13-
#define PARSER_DLL_API extern "C" _declspec(dllimport)
13+
#define PARSER_DLL_API extern "C" _declspec(dllexport)
1414
#else
1515
#define PARSER_DLL_API extern "C" _deslspec(dllimport)
1616
#pragma comment(lib, "parser.lib")

src/postagger/postag_dll.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifdef _WIN32
1111
#undef POSTAGGER_DLL_API
1212
#ifdef POSTAGGER_DLL_API_EXPORT
13-
#define POSTAGGER_DLL_API extern "C" _declspec(dllimport)
13+
#define POSTAGGER_DLL_API extern "C" _declspec(dllexport)
1414
#else
1515
#define POSTAGGER_DLL_API extern "C" _deslspec(dllimport)
1616
#pragma comment(lib, "postagger.lib")

src/segmentor/segment_dll.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifdef _WIN32
1111
#undef SEGMENTOR_DLL_API
1212
#ifdef SEGMENTOR_DLL_API_EXPORT
13-
#define SEGMENTOR_DLL_API extern "C" _declspec(dllimport)
13+
#define SEGMENTOR_DLL_API extern "C" _declspec(dllexport)
1414
#else
1515
#define SEGMENTOR_DLL_API extern "C" _deslspec(dllimport)
1616
#pragma comment(lib, "segmentor.lib")

test/CMakeLists.txt

+20-21
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,41 @@ include_directories (./
22
${SOURCE_DIR}/__util
33
${SOURCE_DIR}/__xml4nlp
44
${SOURCE_DIR}/_split_sentence
5-
${SOURCE_DIR}/_crfwordsegment
6-
${SOURCE_DIR}/_svmtagger
75
${SOURCE_DIR}/_ner
8-
${SOURCE_DIR}/_gparser
96
${SOURCE_DIR}/_srl
107
${SOURCE_DIR}/__ltp_dll
118
${THIRDPARTY_DIR}/crfpp
129
${THIRDPARTY_DIR}/maxent
1310
${THIRDPARTY_DIR}/tinyxml)
1411

1512
set (ltp_test_SRC ltp_test.cpp)
16-
set (ltp_test_xml_SRC ltp_test_xml.cpp)
17-
set (ltp_test2_SRC ltp_test2.cpp)
13+
#set (ltp_test_xml_SRC ltp_test_xml.cpp)
14+
#set (ltp_test2_SRC ltp_test2.cpp)
1815

1916
link_directories ( ${LIBRARY_OUTPUT_PATH} )
2017

2118
add_executable (ltp_test ${ltp_test_SRC})
2219
#add_executable (ltp_test_xml ${ltp_test_xml_SRC})
2320
#add_executable (ltp_test2 ${ltp_test2_SRC})
2421

25-
target_link_libraries (ltp_test
26-
maxent
27-
#crfpp
28-
util
29-
ltp
30-
splitsnt
31-
segmentor
32-
#crfwordseg
33-
postagger
34-
parser
35-
ner
36-
srl
37-
xml4nlp
38-
dl
39-
pthread
40-
boost_regex)
22+
set (ltp_test_LIBS
23+
maxent
24+
util
25+
ltp
26+
splitsnt
27+
segmentor
28+
postagger
29+
parser
30+
ner
31+
srl
32+
xml4nlp
33+
boost_regex)
34+
35+
if (NOT WIN32)
36+
set (ltp_test_LIBS ${ltp_test_LIBS} pthread)
37+
endif()
38+
39+
target_link_libraries (ltp_test ${ltp_test_LIBS})
4140

4241
#target_link_libraries (ltp_test2
4342
# maxent

0 commit comments

Comments
 (0)