-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (32 loc) · 1.03 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
cmake_minimum_required(VERSION 3.10)
project(RubiksCube)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type was specified, building Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
# Add GLFW as subdirectory
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(${CMAKE_SOURCE_DIR}/deps/glfw-3.3.4/)
FILE(GLOB RUBIKSCUBE_SOURCES ${CMAKE_SOURCE_DIR}/src/*.cpp)
add_executable(
RubiksCube
${RUBIKSCUBE_SOURCES}
${CMAKE_SOURCE_DIR}/deps/glad/src/glad.c
)
# Enable compiler warnings
if (MSVC)
target_compile_options(RubiksCube PRIVATE /W3)
else()
target_compile_options(RubiksCube PRIVATE -Wall -Wextra)
endif()
target_link_libraries(RubiksCube glfw)
target_include_directories(
RubiksCube PRIVATE
${CMAKE_SOURCE_DIR}/deps/glfw-3.3.4/include
${CMAKE_SOURCE_DIR}/deps/glm-0.9.9.8/include
${CMAKE_SOURCE_DIR}/deps/glad/include
)