Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake file added #43

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*.out
*.slo
*.so
build/
Makefile
Makefile.in
aclocal.m4
Expand Down
45 changes: 45 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 3.10)

project(marisa)

if(UNIX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Weffc++ -Wextra -Wconversion")
add_compile_options( -fPIC )
endif()

set(MARISA_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

option(Marisa_FOUND "marisa found" ON)
set(Marisa_INCLUDE_PATH ${MARISA_ROOT}/include CACHE INTERNAL "marisa public include path" FORCE)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

set(MARISA_INCLUDE_DIRS
${MARISA_ROOT}/lib
${MARISA_ROOT}/include)

set(MARISA_SRC
${MARISA_ROOT}/lib/marisa/grimoire/io/reader.cc
${MARISA_ROOT}/lib/marisa/grimoire/io/mapper.cc
${MARISA_ROOT}/lib/marisa/grimoire/io/writer.cc
${MARISA_ROOT}/lib/marisa/grimoire/trie/tail.cc
${MARISA_ROOT}/lib/marisa/grimoire/trie/louds-trie.cc
${MARISA_ROOT}/lib/marisa/grimoire/vector/bit-vector.cc
${MARISA_ROOT}/lib/marisa/trie.cc
${MARISA_ROOT}/lib/marisa/agent.cc
${MARISA_ROOT}/lib/marisa/keyset.cc
)

include_directories( ${MARISA_INCLUDE_DIRS} )

add_library( marisa STATIC ${MARISA_SRC} )

install(TARGETS marisa
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

set(include_headers ${MARISA_ROOT}/include/marisa.h)
file(GLOB libmarisa_include_headers ${MARISA_ROOT}/include/marisa/*.h)
install(FILES ${include_headers} DESTINATION include)
install(FILES ${libmarisa_include_headers} DESTINATION include/marisa)