summaryrefslogtreecommitdiff
path: root/training/utils
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2015-04-02 00:50:04 -0400
committerChris Dyer <redpony@gmail.com>2015-04-02 00:50:04 -0400
commit5ee02ce1602f2fce6d5af5db93c2278fe6c9ede5 (patch)
tree7ebad8dd99e38d190c579f425c3eb959363e96e5 /training/utils
parente7d77de8a9b9929b22fc6562f88f3668900f9662 (diff)
parent737ed7a7f932b1a7e40d2755bcdee6bc0aa2de63 (diff)
Merge pull request #70 from redpony/cmake
Cmake
Diffstat (limited to 'training/utils')
-rw-r--r--training/utils/CMakeLists.txt34
-rw-r--r--training/utils/Makefile.am48
2 files changed, 34 insertions, 48 deletions
diff --git a/training/utils/CMakeLists.txt b/training/utils/CMakeLists.txt
new file mode 100644
index 00000000..2753b9f0
--- /dev/null
+++ b/training/utils/CMakeLists.txt
@@ -0,0 +1,34 @@
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../utils)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../mteval)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../decoder)
+
+find_package(Threads REQUIRED)
+
+set(training_utils_STAT_SRCS
+ candidate_set.h
+ entropy.h
+ lbfgs.h
+ online_optimizer.h
+ optimize.h
+ risk.h
+ sentserver.h
+ candidate_set.cc
+ entropy.cc
+ optimize.cc
+ online_optimizer.cc
+ risk.cc)
+
+add_library(training_utils STATIC ${training_utils_STAT_SRCS})
+
+
+set(sentserver_SRCS sentserver.cc)
+add_executable(sentserver ${sentserver_SRCS})
+target_link_libraries(sentserver ${CMAKE_THREAD_LIBS_INIT})
+
+set(sentclient_SRCS sentclient.cc)
+add_executable(sentclient ${sentclient_SRCS})
+target_link_libraries(sentclient ${CMAKE_THREAD_LIBS_INIT})
+
+set(grammar_convert_SRCS grammar_convert.cc)
+add_executable(grammar_convert ${grammar_convert_SRCS})
+target_link_libraries(grammar_convert libcdec mteval utils ${Boost_LIBRARIES} z)
diff --git a/training/utils/Makefile.am b/training/utils/Makefile.am
deleted file mode 100644
index edaaf3d4..00000000
--- a/training/utils/Makefile.am
+++ /dev/null
@@ -1,48 +0,0 @@
-noinst_LIBRARIES = libtraining_utils.a
-
-bin_PROGRAMS = \
- sentserver \
- sentclient \
- grammar_convert
-
-noinst_PROGRAMS = \
- lbfgs_test \
- optimize_test
-
-EXTRA_DIST = decode-and-evaluate.pl libcall.pl parallelize.pl
-
-sentserver_SOURCES = sentserver.cc
-sentserver_LDFLAGS = $(PTHREAD_LIBS)
-sentserver_CXXFLAGS = $(PTHREAD_CFLAGS)
-
-sentclient_SOURCES = sentclient.cc
-sentclient_LDFLAGS = $(PTHREAD_LIBS)
-sentclient_CXXFLAGS = $(PTHREAD_CFLAGS)
-
-TESTS = lbfgs_test optimize_test
-
-libtraining_utils_a_SOURCES = \
- candidate_set.h \
- entropy.h \
- lbfgs.h \
- online_optimizer.h \
- optimize.h \
- risk.h \
- sentserver.h \
- candidate_set.cc \
- entropy.cc \
- optimize.cc \
- online_optimizer.cc \
- risk.cc
-
-optimize_test_SOURCES = optimize_test.cc
-optimize_test_LDADD = libtraining_utils.a ../../utils/libutils.a
-
-grammar_convert_SOURCES = grammar_convert.cc
-grammar_convert_LDADD = ../../decoder/libcdec.a ../../mteval/libmteval.a ../../utils/libutils.a
-
-lbfgs_test_SOURCES = lbfgs_test.cc
-lbfgs_test_LDADD = ../../utils/libutils.a
-
-AM_CPPFLAGS = -W -Wall -Wno-sign-compare -I$(top_srcdir)/decoder -I$(top_srcdir)/utils -I$(top_srcdir)/mteval -I$(top_srcdir)/klm
-