Skip to content

Commit

Permalink
Add CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
rinigus committed Jun 29, 2022
1 parent 26c5c80 commit 822fc52
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
cmake_minimum_required(VERSION 3.6.0)

project(geocoder-nlp
VERSION 1.0.0
DESCRIPTION "Geocoder NLP")

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

include(FindPkgConfig)
include(FeatureSummary)
include(GNUInstallDirs)

find_package(PkgConfig REQUIRED)

pkg_check_modules(MARISA marisa IMPORTED_TARGET)
pkg_check_modules(KYOTOCABINET kyotocabinet IMPORTED_TARGET)
pkg_check_modules(POSTAL postal IMPORTED_TARGET)
pkg_check_modules(SQLITE3 sqlite3 IMPORTED_TARGET)

set(SRC
src/geocoder.cpp
src/postal.cpp)

set(HEAD
src/geocoder.h
src/postal.h)

# sqlite3pp include
include_directories(thirdparty/sqlite3pp/headeronly_src)
include_directories(src)

# demo codes
add_executable(geocoder-nlp
demo/geocoder-nlp.cpp
${SRC}
${HEAD})

target_link_libraries(geocoder-nlp
-lmarisa -lkyotocabinet -lpostal -lsqlite3)

add_executable(nearby-line
demo/nearby-line.cpp
${SRC}
${HEAD})

target_link_libraries(nearby-line
-lmarisa -lkyotocabinet -lpostal -lsqlite3)

add_executable(nearby-point
demo/nearby-point.cpp
${SRC}
${HEAD})

target_link_libraries(nearby-point
-lmarisa -lkyotocabinet -lpostal -lsqlite3)


feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

0 comments on commit 822fc52

Please sign in to comment.