Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohit Jain <Rohit.Jain@microsoft.com>2021-05-25 18:35:32 +0300
committerRohit Jain <Rohit.Jain@microsoft.com>2021-05-25 18:35:32 +0300
commit57e0108553574e26014a5ef6b87da84add953182 (patch)
tree4ebefba0859049e584afe78a7b652ea89605a05d
parent5a97d95ea0abf7fae37c7231d6de3dc3807c6ff5 (diff)
Update CMakeFiles to allow for configurable artifact names
-rw-r--r--CMakeLists.txt20
1 files changed, 8 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d1afe8..0ef8af2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,13 +15,10 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
file(STRINGS "VERSION" SPM_VERSION)
message(STATUS "VERSION: ${SPM_VERSION}")
-option(SPM_ALT_PROJNAME "Call sentencepiece sentencepiecelatest to avoid conflicts" OFF)
+SET(SPM_ARTIFACT_NAME "sentencepiece" CACHE STRING "Default name of the \
+ generated artifacts. Override to avoid name conflicts.")
-if (SPM_ALT_PROJNAME)
-project(sentencepiecelatest VERSION ${SPM_VERSION} LANGUAGES C CXX)
-else()
-project(sentencepiece VERSION ${SPM_VERSION} LANGUAGES C CXX)
-endif()
+project(${SPM_ARTIFACT_NAME} VERSION ${SPM_VERSION} LANGUAGES C CXX)
option(SPM_ENABLE_NFKC_COMPILE "Enables NFKC compile" OFF)
option(SPM_ENABLE_SHARED "Builds shared libaries in addition to static libraries." ON)
@@ -104,12 +101,11 @@ endif()
add_subdirectory(src)
add_subdirectory(third_party)
-if (SPM_ALT_PROJNAME)
-set_target_properties(sentencepiece PROPERTIES OUTPUT_NAME "sentencepiece_latest")
-set_target_properties(sentencepiece_train PROPERTIES OUTPUT_NAME "sentencepiece_train_latest")
-set_target_properties(sentencepiece-static PROPERTIES OUTPUT_NAME "sentencepiece_latest")
-set_target_properties(sentencepiece_train-static PROPERTIES OUTPUT_NAME "sentencepiece_train_latest")
-else()
+if (NOT SPM_ARTIFACT_NAME STREQUAL "sentencepiece")
+ set_target_properties(sentencepiece PROPERTIES OUTPUT_NAME ${SPM_ARTIFACT_NAME})
+ set_target_properties(sentencepiece_train PROPERTIES OUTPUT_NAME "${SPM_ARTIFACT_NAME}_train")
+ set_target_properties(sentencepiece-static PROPERTIES OUTPUT_NAME ${SPM_ARTIFACT_NAME})
+ set_target_properties(sentencepiece_train-static PROPERTIES OUTPUT_NAME "${SPM_ARTIFACT_NAME}_train")
endif()
set(CPACK_SOURCE_GENERATOR "TXZ")