-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (40 loc) · 1.38 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
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
project(SolarSystem)
# OPENGL
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
list(APPEND INCLUDES ${OPENGL_INCLUDE_DIR})
list(APPEND LIBS ${OPENGL_LIBRARIES})
# GLFW
add_subdirectory(vendor/glfw)
list(APPEND LIBS glfw)
# GLAD
add_subdirectory(vendor/glad)
list(APPEND LIBS glad)
# IMGUI
add_subdirectory(vendor/imgui)
list(APPEND LIBS imgui)
# STB_IMAGE
list(APPEND INCLUDES vendor/stb)
# GLM
list(APPEND INCLUDES vendor/glm)
# JSON
list(APPEND INCLUDES vendor/json)
# Add extra libraries based on the operating system.
if(WIN32)
list(APPEND gdi32 user32)
else()
list(APPEND LIBS X11 Xxf86vm Xrandr pthread Xi dl Xinerama Xcursor)
endif()
set(SOURCE_FILES src/Scripts/SolarSystem.cpp src/Scripts/SolarSystem.h
src/Scripts/Model.cpp src/Scripts/Model.h src/Scripts/Mesh.h
src/Scripts/Shader.h src/Scripts/Camera.h)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
# Set this project as startup project
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
target_compile_definitions(${PROJECT_NAME} PUBLIC PROJECT_DIR="${PROJECT_SOURCE_DIR}")
target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDES})
target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBS})