-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (47 loc) · 1.08 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
cmake_minimum_required(VERSION 3.18)
set(PROJECT_NAME Projectname)
project(${PROJECT_NAME} C CXX ASM)
project(PRERELEASE VERSION 0.1.0)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}
project-name/src/main.c
# project-name/src/main.cpp
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
#sfml-graphics
)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/project-name/src
${CMAKE_CURRENT_LIST_DIR}/project-name/include
)
# GCC
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-O2 -g3
-Wall
-Wno-unused-result
-Wno-format
-Wno-unused-function
-Wno-maybe-uninitialized
-Werror
)
endif()
# Clang
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-O2 -g3
-Wall
-Wno-unused-result
-Wno-format
-Werror
)
endif()
# Microsoft Visual C++
if(MSVC)
add_compile_options(/W4
/WX
)
endif()
add_subdirectory(project-name/src)