-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
57 lines (44 loc) · 1.21 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
cmake_minimum_required(VERSION 3.17)
project(Kulki)
set(CMAKE_CXX_STANDARD 20)
if(UNIX)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif(UNIX)
add_subdirectory(SFML)
include_directories(
src/BabelLib
include
)
file(GLOB_RECURSE SRC_FILES src/function/*.cpp src/object/*.cpp)
file(GLOB_RECURSE HEADERS_FILES include/*.hpp include/*.h)
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
add_definitions(-D__32BITVERSION__)
else()
add_definitions(-D__64BITVERSION__)
endif()
add_executable(Kulki
main.cpp
${SRC_FILES}
)
target_compile_options(Kulki PRIVATE -O3 -Wextra -Werror -W -Wshadow -Wdouble-promotion -Wformat=2 -Wundef -fno-common -Wconversion -pedantic -Wall)
if(UNIX)
target_link_libraries(Kulki PUBLIC Threads::Threads)
endif(UNIX)
target_link_libraries(Kulki PRIVATE
sfml-window
sfml-graphics
sfml-system
)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/ball_texture
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/font
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(
clangformat
COMMAND /usr/bin/clang-format
-i
${SRC_FILES}
${HEADERS_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)