-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
62 lines (49 loc) · 1.53 KB
/
CMakeLists.txt
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
cmake_minimum_required (VERSION 3.10)
### Configure build type if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
project(queso CXX)
add_subdirectory(3rdparty)
add_subdirectory(chips)
add_subdirectory(tests)
### Use build/out for install directory
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/out" CACHE PATH "binary output directory" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
### Require out-of-source builds
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
message(FATAL_ERROR "You cannot build in a source directory \
(or any directory with a CMakeLists.txt file). Please make a build subdirectory.\
Feel free to remove CMakeCache.txt and CMakeFiles.")
endif()
### Check for cURL
set(CURL_LIBRARY "-lcurl")
find_package(CURL REQUIRED)
if(NOT TARGET spdlog)
# Stand-alone build
find_package(spdlog REQUIRED)
endif()
set(SOURCES
main.cpp
timer.cpp
twitch.cpp
quesoqueue.cpp
chat.cpp
chips.cpp
obs_text_source.cpp
)
add_executable(
${PROJECT_NAME}
${SOURCES}
)
include_directories(${CURL_INCLUDE_DIR})
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
endif()
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
spdlog_enable_warnings(${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES} spdlog::spdlog dl stdc++fs SimpleJSON)