forked from google/sentencepiece
-
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
23 changed files
with
432 additions
and
432 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright 2018 Google Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License.! | ||
|
||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR) | ||
project(sentencepiece VERSION 0.1.2 LANGUAGES CXX) | ||
|
||
option(SPM_ENABLE_NFKC_COMPILE "Enables NFKC compile" OFF) | ||
option(SPM_ENABLE_SHARED "Builds shared libaries in addition to static libraries." ON) | ||
option(SPM_BUILD_TEST "Builds test binaries." OFF) | ||
option(SPM_COVERAGE "Runs gcov to test coverage." OFF) | ||
option(SPM_ENABLE_TENSORFLOW_SHARED "Makes a tensorflow compatible shared file." OFF) | ||
option(SPM_ENABLE_TCMALLOC "Enable TCMalloc if available." ON) | ||
option(SPM_TCMALLOC_STATIC "Link static library of TCMALLOC." OFF) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(prefix ${CMAKE_INSTALL_PREFIX}) | ||
set(exec_prefix "\${prefix}") | ||
set(libdir "\${exec_prefix}/lib") | ||
set(includedir "\${prefix}/include") | ||
set(GNUCXX_STD_SUPPORT_VERSION "4.3") | ||
|
||
if (APPLE) | ||
set(CMAKE_MACOSX_RPATH ON) | ||
set(CMAKE_SKIP_BUILD_RPATH FALSE) | ||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) | ||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") | ||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | ||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) | ||
if ("${isSystemDir}" STREQUAL "-1") | ||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") | ||
endif() | ||
endif() | ||
|
||
if (NOT DEFINED CMAKE_INSTALL_BINDIR) | ||
set(CMAKE_INSTALL_BINDIR bin) | ||
endif() | ||
|
||
if (NOT DEFINED CMAKE_INSTALL_LIBDIR) | ||
set(CMAKE_INSTALL_LIBDIR lib) | ||
endif() | ||
|
||
if (NOT DEFINED CMAKE_INSTALL_LIBDIR) | ||
set(CMAKE_INSTALL_LIBDIR lib) | ||
endif() | ||
|
||
if (NOT DEFINED CMAKE_INSTALL_INCDIR) | ||
set(CMAKE_INSTALL_INCDIR include) | ||
endif() | ||
|
||
configure_file("${PROJECT_SOURCE_DIR}/config.h.in" "config.h") | ||
configure_file("${PROJECT_SOURCE_DIR}/sentencepiece.pc.in" "sentencepiece.pc" @ONLY) | ||
|
||
if (NOT MSVC) | ||
install(FILES "${CMAKE_BINARY_DIR}/sentencepiece.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||
endif() | ||
|
||
include_directories(${CMAKE_SOURCE_DIR} ${PROJECT_BINARY_DIR}) | ||
|
||
if (SPM_BUILD_TEST) | ||
enable_testing() | ||
endif() | ||
|
||
add_subdirectory(src) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
#ifndef CONFIG_H_ | ||
#define CONFIG_H_ | ||
|
||
#define VERSION "@PROJECT_VERSION@" | ||
#define PACKAGE "@PROJECT_NAME@" | ||
#define PACKAGE_STRING "@PROJECT_NAME@" | ||
|
||
|
||
#endif // CONFIG_H_ |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.