forked from kpu/kenlm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
find_package(PythonInterp REQUIRED) | ||
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT REQUIRED) | ||
include_directories(${PYTHON_INCLUDE_DIRS}) | ||
|
||
add_library(kenlm_python MODULE kenlm.cpp score_sentence.cc) | ||
set_target_properties(kenlm_python PROPERTIES OUTPUT_NAME kenlm) | ||
set_target_properties(kenlm_python PROPERTIES PREFIX "") | ||
|
||
if(APPLE) | ||
set_target_properties(kenlm_python PROPERTIES SUFFIX ".so") | ||
elseif(WIN32) | ||
set_target_properties(kenlm_python PROPERTIES SUFFIX ".pyd") | ||
endif() | ||
|
||
target_link_libraries(kenlm_python kenlm) | ||
if(WIN32) | ||
target_link_libraries(kenlm_python ${PYTHON_LIBRARIES}) | ||
elseif(APPLE) | ||
set_target_properties(kenlm_python PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") | ||
endif() | ||
|
||
if (WIN32) | ||
set (PYTHON_SITE_PACKAGES Lib/site-packages) | ||
else () | ||
set (PYTHON_SITE_PACKAGES lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) | ||
endif () | ||
|
||
install(TARGETS kenlm_python DESTINATION ${PYTHON_SITE_PACKAGES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters