-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (39 loc) · 1.31 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.12)
# Change ProjectName and version to your liking.
project(ProjectName VERSION 0.1.0)
# To compile first creare a "build" directory in this folder.
# "mkdir build"
# Enter the build directory
# "cd build"
# Run cmake:
# "cmake .."
# To make a debug build:
# "cmake --build ."
# To make a release build:
# "cmake --build . --config Release"
# The generated binaries will be placed in the "build_output" folder
set(CMAKE_CXX_STANDARD 17)
# Add you source files here
set(SOURCES
src/main.cpp
# src/example.cpp
)
# Add your header files here
set(HEADERS
# src/example.hpp
)
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
# Add a macro like this:
#target_compile_definitions(${PROJECT_NAME} PRIVATE SOME_MACRO)
# This line creates the source code directory structure in visual studio.
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/src" PREFIX Sources FILES ${SOURCES} ${HEADERS})
# GLAD
add_subdirectory(dependencies/glad)
target_link_libraries(${PROJECT_NAME} glad)
# GLFW
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(dependencies/glfw)
target_link_libraries(${PROJECT_NAME} glfw)