Test using sherpa-onnx as a cmake subproject (#1961)
This commit is contained in:
17
.github/scripts/as-cmake-sub-project/CMakeLists.txt
vendored
Normal file
17
.github/scripts/as-cmake-sub-project/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||
|
||||
project(use-of-sherpa-onnx-as-a-sub-project)
|
||||
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/sherpa-onnx/setup.py")
|
||||
message(FATAL_ERROR "Please download the source code of sherpa-onnx and put it inside this directory")
|
||||
endif()
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
|
||||
include_directories(./sherpa-onnx)
|
||||
add_subdirectory(./sherpa-onnx)
|
||||
|
||||
add_executable(main main.cc)
|
||||
target_link_libraries(main sherpa-onnx-core)
|
||||
Reference in New Issue
Block a user