-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
145 lines (139 loc) · 3.24 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
cmake_minimum_required(VERSION 3.21)
project(imagep VERSION 0.0.0)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Generate compile_commands.json for ccls
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Group CMake targets inside a folder
add_subdirectory(deps/stb)
find_package(glm CONFIG REQUIRED)
find_package(asio CONFIG REQUIRED)
find_package(Threads REQUIRED)
# Image library
project(image)
set(TARGET_SOURCE_FILES
"image.hpp"
"image.cpp"
)
add_library(${PROJECT_NAME} OBJECT ${TARGET_SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PRIVATE
"${PROJECT_SOURCE_DIR}"
)
target_link_libraries(${PROJECT_NAME}
stb
glm::glm
Threads::Threads
)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
if (NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
"-Wall"
"-Wextra"
"-Wconversion"
"-Wpedantic"
"-Wshadow"
"-Werror"
)
else()
target_compile_options(${PROJECT_NAME} PRIVATE
"/W4"
"/WX"
)
endif()
source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" FILES ${TARGET_SOURCE_FILES})
# Dithering
project(dither)
set(TARGET_SOURCE_FILES
"dither.cpp"
)
add_executable(${PROJECT_NAME} ${TARGET_SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PRIVATE
"${PROJECT_SOURCE_DIR}"
)
target_link_libraries(${PROJECT_NAME}
stb
glm::glm
asio::asio
Threads::Threads
image
)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
if (NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
"-Wall"
"-Wextra"
"-Wconversion"
"-Wpedantic"
"-Wshadow"
"-Werror"
)
else()
target_compile_options(${PROJECT_NAME} PRIVATE
"/W4"
"/WX"
)
endif()
source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" FILES ${TARGET_SOURCE_FILES})
# Box blur
project(boxblur)
set(TARGET_SOURCE_FILES
"boxblur.cpp"
)
add_executable(${PROJECT_NAME} ${TARGET_SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PRIVATE
"${PROJECT_SOURCE_DIR}"
)
target_link_libraries(${PROJECT_NAME}
stb
glm::glm
asio::asio
Threads::Threads
image
)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
if (NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
"-Wall"
"-Wextra"
"-Wconversion"
"-Wpedantic"
"-Wshadow"
"-Werror"
)
else()
target_compile_options(${PROJECT_NAME} PRIVATE
"/W4"
"/WX"
)
endif()
source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" FILES ${TARGET_SOURCE_FILES})
# Gaussian blur
project(gaussian)
set(TARGET_SOURCE_FILES
"gaussian.cpp"
)
add_executable(${PROJECT_NAME} ${TARGET_SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PRIVATE
"${PROJECT_SOURCE_DIR}"
)
target_link_libraries(${PROJECT_NAME}
stb
glm::glm
asio::asio
Threads::Threads
image
)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
if (NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
"-Wall"
"-Wextra"
"-Wconversion"
"-Wpedantic"
"-Wshadow"
"-Werror"
)
else()
target_compile_options(${PROJECT_NAME} PRIVATE
"/W4"
"/WX"
)
endif()
source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" FILES ${TARGET_SOURCE_FILES})