Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
cmake: generate fasttext.pc for pkg-config (#916)
Browse files Browse the repository at this point in the history
Summary:
Closes: #915
Pull Request resolved: #916

Reviewed By: EdouardGrave, tscmoo

Differential Revision: D17737706

Pulled By: Celebio

fbshipit-source-id: 8ee38ee0430e08260d498f446c4475ee4ad62629
  • Loading branch information
kenhys authored and facebook-github-bot committed Apr 28, 2020
1 parent 64a946b commit ddb5440
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ set(SOURCE_FILES
src/utils.cc
src/vector.cc)


if (NOT MSVC)
include(GNUInstallDirs)
configure_file("fasttext.pc.in" "fasttext.pc" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/fasttext.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()

add_library(fasttext-shared SHARED ${SOURCE_FILES} ${HEADER_FILES})
add_library(fasttext-static STATIC ${SOURCE_FILES} ${HEADER_FILES})
add_library(fasttext-static_pic STATIC ${SOURCE_FILES} ${HEADER_FILES})
Expand Down
10 changes: 10 additions & 0 deletions fasttext.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_FULL_LIBEXECDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: @PROJECT_NAME@
Description: Efficient learning of word representations and sentence classification
Version: @PROJECT_VERSION@
Libs: -L${libdir} -lfasttext
Cflags: -I${includedir}

0 comments on commit ddb5440

Please sign in to comment.