-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.cmake
91 lines (84 loc) · 2.13 KB
/
log.cmake
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
macro(__enable_spdlog)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/spdlog/CMakeLists.txt)
add_subdirectory(spdlog)
set(SPDLOG_FROM_SOURCE 1)
else()
__cc_find(Cxlog)
set(SPDLOG_FROM_SOURCE 0)
endif()
if(TARGET cxlog)
message(STATUS "__enable_spdlog success.")
set(CC_GLOBAL_SPDLOG_ENABLED 1)
if(SPDLOG_FROM_SOURCE)
message(STATUS "from source.")
else()
message(STATUS "from binary.")
endif()
else()
message(STATUS "__enable_spdlog failed.")
set(CC_GLOBAL_SPDLOG_ENABLED 0)
endif()
endmacro()
macro(__enable_static_spdlog)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/spdlog/CMakeLists.txt)
add_subdirectory(spdlog)
set(SPDLOG_FROM_SOURCE 1)
else()
__cc_find(cxlog_static)
set(SPDLOG_FROM_SOURCE 0)
endif()
if(TARGET cxlog_static)
message(STATUS "__enable_spdlog success.")
set(CC_GLOBAL_SPDLOG_ENABLED 1)
if(SPDLOG_FROM_SOURCE)
message(STATUS "from source.")
else()
message(STATUS "from binary.")
endif()
else()
message(STATUS "__enable_spdlog failed.")
set(CC_GLOBAL_SPDLOG_ENABLED 0)
endif()
endmacro()
macro(__enable_shiny)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/shiny/CMakeLists.txt)
add_subdirectory(shiny)
set(SHINY_FROM_SOURCE 1)
else()
__cc_find(shiny)
set(SHINY_FROM_SOURCE 0)
endif()
if(TARGET shiny)
message(STATUS "__enable_shiny success.")
set(CC_GLOBAL_SHINY_ENABLED 1)
if(SHINY_FROM_SOURCE)
message(STATUS "from source.")
else()
message(STATUS "from binary.")
endif()
else()
message(STATUS "__enable_shiny failed.")
set(CC_GLOBAL_SHINY_ENABLED 0)
endif()
endmacro()
macro(__enable_system_support)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/system_support/CMakeLists.txt)
add_subdirectory(system_support)
set(SYSTEM_SUPPORT_FROM_SOURCE 1)
else()
__cc_find(system_support)
set(SYSTEM_SUPPORT_FROM_SOURCE 0)
endif()
if(TARGET system_support)
message(STATUS "__enable_system_support success.")
set(CC_GLOBAL_SYSTEM_SUPPORT_ENABLED 1)
if(system_support)
message(STATUS "from source.")
else()
message(STATUS "from binary.")
endif()
else()
message(STATUS "__enable_system_support failed.")
set(CC_GLOBAL_SYSTEM_SUPPORT_ENABLED 0)
endif()
endmacro()