-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (40 loc) · 1.25 KB
/
CMakeLists.txt
File metadata and controls
52 lines (40 loc) · 1.25 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
48
49
50
51
52
cmake_minimum_required(VERSION 3.0)
project(shohih)
# Flag for building tests (OFF by default)
option(BUILD_TEST "Turn ON/OFF building test files" OFF)
# Shohih lib & executable
set(SHOHIH_LIB shohih)
set(SHOHIH_MAIN shohih_main)
set(SHOHIH_SERVER shohih_server)
# Executables at ./output/exe
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/output/exe)
# Libraries at ./output/lib
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/output/lib)
# GoogleTest requires >=C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# GCC flags
set(CMAKE_CXX_FLAGS
"-Wall -Werror -Wextra -Wshadow -Wnon-virtual-dtor -Wunused -pedantic"
)
# Third-party libraries
set(RAYLIB_INCLUDE ${CMAKE_SOURCE_DIR}/third_party/raylib/src)
set(HTTPLIB_INCLUDE ${CMAKE_SOURCE_DIR}/third_party/cpp-httplib)
set(GTEST_INCLUDE ${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include)
# Include directories
include_directories(
PUBLIC ${CMAKE_SOURCE_DIR}/src/include
)
# Link directories
link_directories(
PUBLIC ${CMAKE_SOURCE_DIR}/output/lib
)
# Test cases
if(BUILD_TEST)
add_subdirectory(test)
add_compile_definitions(BUILD_TEST)
endif(BUILD_TEST)
# Source files
add_subdirectory(src)
# Third-party libraries
add_subdirectory(third_party)