-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·68 lines (56 loc) · 2.13 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
57
58
59
60
61
62
63
64
65
66
67
68
# Setup CMake
#set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
#set(CMAKE_COLOR_DIAGNOSTICS ON)
set(CMAKE_CXX_STANDARD 17)
cmake_minimum_required(VERSION 3.20)
# Project Setup
project(openglEngine VERSION 1.0)
set(SOURCES
"src/main.cpp"
"src/Util.cpp"
"src/Collision.cpp"
"src/include/Window.hpp"
"src/include/UI.hpp"
"src/include/Util.hpp"
"src/include/Mesh.hpp"
"src/include/Model.hpp"
"src/include/PhysicsDrawer.hpp"
"src/include/PhysicsEngine.hpp"
"src/include/ObjectHandler.hpp"
"src/include/FileHandler.hpp"
"src/include/Collision.h"
"src/include/Heightmap.hpp"
"src/include/GameObject.hpp"
"src/include/StaticBody.hpp"
"src/include/shader/BaseShader.hpp"
"src/include/shader/TextShader.hpp"
"src/include/shader/CubeShader.hpp"
"src/include/ecs/ECS.hpp"
"src/include/ecs/VehicleComponent.hpp"
)
if(WIN32)
set(CMAKE_CXX_COMPILER "C:/Users/JTK6759/Documents/apps/msys64/ucrt64/bin/g++.exe")
set(COMPILE_FLAGS="-g -Wall -Dmain=SDL_main")
add_link_options("-lmingw32" "-lSDL2" "-lSDL2main")
add_executable(openglEngine)
target_include_directories(openglEngine PRIVATE
"C:/Users/JTK6759/Documents/apps/msys64/ucrt64/include/freetype2/"
"C:/Users/JTK6759/Documents/apps/msys64/ucrt64/include/bullet/"
)
target_compile_definitions(openglEngine PRIVATE DEBUG WIN32)
target_link_libraries(openglEngine PRIVATE SDL2 SOIL opengl32 glew32 freeglut assimp freetype BulletDynamics BulletCollision LinearMath BulletWorldImporter jsoncpp)
else()
set(CMAKE_CXX_COMPILER "/usr/bin/g++")
set(COMPILE_FLAGS="-g -Wall")
add_executable(openglEngine)
# If your distro used freetype2 for freetype 2.x
if(NOT EXISTS "/usr/include/freetype/")
target_include_directories(openglEngine PRIVATE "/usr/include/freetype2/")
endif()
target_include_directories(openglEngine PRIVATE "/usr/include/bullet/")
target_compile_definitions(openglEngine PRIVATE DEBUG)
target_link_libraries(openglEngine PRIVATE SDL2 GL GLEW SOIL assimp freetype BulletDynamics BulletCollision LinearMath BulletWorldImporter jsoncpp)
endif()
target_sources(openglEngine PRIVATE ${SOURCES})
target_include_directories(openglEngine PRIVATE "src/" "src/include/")