Skip to content

Commit 6f81256

Browse files
committed
Install the sentencepiece headers and fix include path
I'm not sure exactly why, but we weren't installing the sentencepiece headers. We also need to set our include path to point at our installed headers.
1 parent 93be043 commit 6f81256

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ target_include_directories(
8282
tokenizers
8383
PUBLIC
8484
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
85+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/pytorch/tokenizers>
8586
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third-party/sentencepiece>
8687
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third-party/sentencepiece/src>
8788
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third-party/re2>
@@ -190,6 +191,13 @@ install(
190191
PATTERN "*.h"
191192
)
192193

194+
install(
195+
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/third-party/sentencepiece/src/
196+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pytorch/tokenizers
197+
FILES_MATCHING
198+
PATTERN "sentencepiece_processor.h"
199+
PATTERN "sentencepiece_trainer.h"
200+
)
193201
install(
194202
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/third-party/json/single_include/
195203
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}

0 commit comments

Comments
 (0)