forked from alibaba/yalantinglibs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
48 lines (41 loc) · 1.54 KB
/
Copy pathCMakeLists.txt
File metadata and controls
48 lines (41 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.15)
# Create an option to control CUDA usage, defaulting to whether CUDA was found
option(YLT_ENABLE_CUDA "Enable CUDA support" OFF)
# Set project languages based on the option and CUDA availability
if(YLT_ENABLE_CUDA)
set(CMAKE_CUDA_ARCHITECTURES 86)
set(PROJECT_LANGUAGES CXX CUDA)
else()
set(PROJECT_LANGUAGES CXX)
endif()
project(yaLanTingLibs
VERSION 0.6.0
DESCRIPTION "yaLanTingLibs"
HOMEPAGE_URL "https://github.com/alibaba/yalantinglibs"
LANGUAGES ${PROJECT_LANGUAGES}
)
# load pack finder
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Find/)
find_package(Threads REQUIRED)
link_libraries(Threads::Threads)
include(cmake/install.cmake)
if(CMAKE_PROJECT_NAME STREQUAL "yaLanTingLibs") # if ylt is top-level project
# add include path
include_directories(include)
include_directories(include/ylt/thirdparty)
include_directories(include/ylt/standalone)
include_directories(src/include)
include(cmake/Find/find_openssl.cmake)
include(cmake/Find/find_ntls.cmake)
include(cmake/Find/find_ibverbs.cmake)
include(cmake/utils.cmake)
include(cmake/build.cmake)
include(cmake/develop.cmake)
# add project config, such as enable_ssl.
include(cmake/config.cmake)
# add project's source such as unit test, example & benchmark
include(cmake/subdir.cmake)
else ()
# add project config, such as enable_ssl.
include(cmake/config.cmake)
endif()