Allow building repository as CMake subdirectory (#2059)
* Use PROJECT_SOURCE_DIR rather than CMAKE_SOURCE_DIR to allow building as subdirectory * Also use PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR in c/cxx api examples * Only build examples by default when not building as subdirectory * Do not suggest building binaries either --------- Co-authored-by: user <user@mail.tld>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
include_directories(${PROJECT_SOURCE_DIR})
|
||||
|
||||
set(srcs
|
||||
audio-tagging.cc
|
||||
@@ -51,7 +51,7 @@ set(srcs
|
||||
wave-writer.cc
|
||||
)
|
||||
if(SHERPA_ONNX_HAS_ALSA)
|
||||
list(APPEND srcs ${CMAKE_SOURCE_DIR}/sherpa-onnx/csrc/alsa.cc alsa.cc)
|
||||
list(APPEND srcs ${PROJECT_SOURCE_DIR}/sherpa-onnx/csrc/alsa.cc alsa.cc)
|
||||
else()
|
||||
list(APPEND srcs faked-alsa.cc)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user