From f413086905baa916b41c86d5b85a183bdc74d38b Mon Sep 17 00:00:00 2001 From: Benoit Favre <benoit.favre@lif.univ-mrs.fr> Date: Tue, 7 Nov 2017 14:49:53 +0100 Subject: [PATCH] add support for libmacaon2.so --- CMakeLists.txt | 24 ++++++++++++++++++++++++ maca_common/CMakeLists.txt | 3 ++- maca_crf_tagger/CMakeLists.txt | 2 ++ maca_lemmatizer/CMakeLists.txt | 1 + maca_lexer/CMakeLists.txt | 1 + maca_tokenizer/CMakeLists.txt | 1 + maca_trans_parser/CMakeLists.txt | 1 + 7 files changed, 32 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c53a8c1..c15d237 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,4 +47,28 @@ if(MACA_EXPORT) add_subdirectory(maca_export) endif() +#create macaon library target +set(MACAON_LIBRARY_SOURCES + $<TARGET_OBJECTS:maca_common_obj> + $<TARGET_OBJECTS:maca_lemmatizer_obj> + $<TARGET_OBJECTS:maca_tokenizer_obj> + $<TARGET_OBJECTS:maca_lexer_obj> + $<TARGET_OBJECTS:transparse_obj> + $<TARGET_OBJECTS:maca_crf_tagger_obj> +) + +## $<TARGET_OBJECTS:maca_chunker_obj> +## $<TARGET_OBJECTS:maca_tagger_obj> + +#set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols") +add_library(macaon SHARED ${MACAON_LIBRARY_SOURCES}) +#add_library(macaon_static STATIC ${MACAON_LIBRARY_SOURCES}) +#target_link_libraries(macaon ${LIBM_C_FLAGS} ${GFSM_LIBRARY} ${FST_LIBRARY} ${LIBXML2_LIBRARIES} ${GLIB2_LIBRARIES} ${MINGW_LIBRARIES}) +#set_target_properties(macaon PROPERTIES SOVERSION "${MACAON_VERSION}") +#target_compile_definitions(macaon PUBLIC MACAON_VERSION=${MACAON_VERSION}) +#set(MACAON_LIB_TARGETS ${MACAON_LIB_TARGETS} macaon) +#set_target_properties(macaon_static PROPERTIES OUTPUT_NAME "macaon") +#set(MACAON_STATIC_LIB_TARGETS ${MACAON_STATIC_LIB_TARGETS} macaon_static) + + #set(CMAKE_INSTALL_PREFIX ../) diff --git a/maca_common/CMakeLists.txt b/maca_common/CMakeLists.txt index f54ad51..4ab7c0e 100644 --- a/maca_common/CMakeLists.txt +++ b/maca_common/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SOURCES src/util.c +set(SOURCES src/util.c src/hash.c src/dico.c src/word_emb.c @@ -19,6 +19,7 @@ set(SOURCES src/util.c #compiling library add_library(maca_common STATIC ${SOURCES}) +add_library(maca_common_obj OBJECT ${SOURCES}) #compiling, linking and installing executables diff --git a/maca_crf_tagger/CMakeLists.txt b/maca_crf_tagger/CMakeLists.txt index 6df7df6..7b8fa6b 100644 --- a/maca_crf_tagger/CMakeLists.txt +++ b/maca_crf_tagger/CMakeLists.txt @@ -1,8 +1,10 @@ include_directories(src) #compiling, linking and installing executables +add_library(maca_crf_tagger_obj OBJECT ./src/simple_tagger.cc) add_executable(crf_barebones_decoder ./src/crf_barebones_decoder.cc) + target_compile_options(crf_barebones_decoder PRIVATE -std=c++11) install (TARGETS crf_barebones_decoder DESTINATION bin) diff --git a/maca_lemmatizer/CMakeLists.txt b/maca_lemmatizer/CMakeLists.txt index a4f7e9d..0e188f8 100644 --- a/maca_lemmatizer/CMakeLists.txt +++ b/maca_lemmatizer/CMakeLists.txt @@ -3,6 +3,7 @@ set(SOURCES src/context.c) ##compiling library include_directories(src) add_library(maca_lemmatizer_lib STATIC ${SOURCES}) +add_library(maca_lemmatizer_obj OBJECT ${SOURCES}) #compiling, linking and installing executables diff --git a/maca_lexer/CMakeLists.txt b/maca_lexer/CMakeLists.txt index 8c42bcf..345b376 100644 --- a/maca_lexer/CMakeLists.txt +++ b/maca_lexer/CMakeLists.txt @@ -3,6 +3,7 @@ set(SOURCES src/context.c) ##compiling library include_directories(src) add_library(maca_lexer_lib STATIC ${SOURCES}) +add_library(maca_lexer_obj OBJECT ${SOURCES}) #compiling, linking and installing executables diff --git a/maca_tokenizer/CMakeLists.txt b/maca_tokenizer/CMakeLists.txt index 0952a2b..5a900fe 100644 --- a/maca_tokenizer/CMakeLists.txt +++ b/maca_tokenizer/CMakeLists.txt @@ -10,6 +10,7 @@ set(SOURCES ./src/context.c include_directories(./src) add_library(maca_tokenizer_lib STATIC ${SOURCES}) +add_library(maca_tokenizer_obj OBJECT ${SOURCES}) #compiling, linking and installing executables diff --git a/maca_trans_parser/CMakeLists.txt b/maca_trans_parser/CMakeLists.txt index a3cded9..b65e665 100644 --- a/maca_trans_parser/CMakeLists.txt +++ b/maca_trans_parser/CMakeLists.txt @@ -34,6 +34,7 @@ set(SOURCES src/context.c #compiling library include_directories(src) add_library(transparse STATIC ${SOURCES}) +add_library(transparse_obj OBJECT ${SOURCES}) target_link_libraries(transparse perceptron) #compiling, linking and installing executables -- GitLab