2021-09-13 15:53:43 +03:00
|
|
|
cmake_minimum_required(VERSION 3.17)
|
|
|
|
project(shooter)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
|
2021-10-09 13:41:12 +03:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
2021-09-13 15:53:43 +03:00
|
|
|
|
2022-02-23 07:51:53 +03:00
|
|
|
add_executable(${CMAKE_PROJECT_NAME}
|
2021-09-13 15:53:43 +03:00
|
|
|
# game:
|
2021-10-09 13:41:12 +03:00
|
|
|
Source.cpp
|
2022-07-19 12:37:37 +03:00
|
|
|
player/Player.cpp
|
|
|
|
player/Player.h
|
2022-07-19 12:35:14 +03:00
|
|
|
network/ShooterClient.cpp
|
|
|
|
network/ShooterClient.h
|
|
|
|
network/ShooterServer.cpp
|
|
|
|
network/ShooterServer.h
|
2021-09-14 13:47:53 +03:00
|
|
|
weapon/Weapon.cpp
|
|
|
|
weapon/Weapon.h
|
|
|
|
weapon/Ak47.h
|
|
|
|
weapon/Shotgun.h
|
|
|
|
weapon/Gun.h
|
|
|
|
weapon/Gold_Ak47.h
|
|
|
|
weapon/Rifle.h
|
2022-07-19 12:37:37 +03:00
|
|
|
player/PlayerController.cpp
|
|
|
|
player/PlayerController.h
|
2021-10-02 21:17:03 +03:00
|
|
|
Shooter.cpp
|
|
|
|
Shooter.h
|
2021-10-17 08:35:12 +03:00
|
|
|
ShooterConsts.h
|
2022-07-19 12:35:14 +03:00
|
|
|
network/ShooterMsgType.h
|
|
|
|
network/ShooterMsgType.cpp
|
2022-07-22 22:52:54 +03:00
|
|
|
network/Chat.cpp
|
|
|
|
network/Chat.h
|
2021-09-13 15:53:43 +03:00
|
|
|
# 3d engine:
|
2021-10-17 08:35:12 +03:00
|
|
|
engine/Consts.h
|
2022-07-11 16:58:05 +03:00
|
|
|
engine/math/Vec4D.h
|
|
|
|
engine/math/Vec4D.cpp
|
|
|
|
engine/math/Vec3D.cpp
|
|
|
|
engine/math/Vec3D.h
|
|
|
|
engine/math/Vec2D.cpp
|
|
|
|
engine/math/Vec2D.h
|
|
|
|
engine/math/Matrix4x4.h
|
|
|
|
engine/math/Matrix4x4.cpp
|
2021-09-13 15:53:43 +03:00
|
|
|
engine/Triangle.h
|
|
|
|
engine/Triangle.cpp
|
2022-07-11 16:58:05 +03:00
|
|
|
engine/math/Plane.h
|
|
|
|
engine/math/Plane.cpp
|
2021-09-13 15:53:43 +03:00
|
|
|
engine/Mesh.h
|
|
|
|
engine/Mesh.cpp
|
|
|
|
engine/utils/Log.h
|
|
|
|
engine/utils/Log.cpp
|
2021-10-17 19:38:16 +03:00
|
|
|
engine/utils/Time.h
|
|
|
|
engine/utils/Time.cpp
|
2021-11-03 23:00:19 +03:00
|
|
|
engine/utils/Timer.cpp
|
|
|
|
engine/utils/Timer.h
|
2022-07-11 16:58:05 +03:00
|
|
|
engine/utils/ResourceManager.h
|
|
|
|
engine/utils/ResourceManager.cpp
|
2021-09-13 15:53:43 +03:00
|
|
|
engine/World.h
|
|
|
|
engine/World.cpp
|
|
|
|
engine/Camera.h
|
|
|
|
engine/Camera.cpp
|
2022-07-11 16:58:05 +03:00
|
|
|
engine/io/Screen.h
|
|
|
|
engine/io/Screen.cpp
|
2021-09-13 15:53:43 +03:00
|
|
|
engine/Engine.h
|
|
|
|
engine/Engine.cpp
|
2022-07-11 16:58:05 +03:00
|
|
|
engine/io/Keyboard.cpp
|
|
|
|
engine/io/Keyboard.h
|
|
|
|
engine/io/Mouse.cpp
|
|
|
|
engine/io/Mouse.h
|
|
|
|
engine/io/SoundController.cpp
|
|
|
|
engine/io/SoundController.h
|
2022-07-19 13:16:57 +03:00
|
|
|
engine/utils/ObjectController.cpp
|
|
|
|
engine/utils/ObjectController.h
|
2021-09-13 15:53:43 +03:00
|
|
|
engine/animation/Animation.h
|
2021-10-02 21:17:03 +03:00
|
|
|
engine/animation/Timeline.cpp
|
|
|
|
engine/animation/Timeline.h
|
2021-09-13 15:53:43 +03:00
|
|
|
engine/animation/Interpolation.h
|
|
|
|
engine/animation/Animation.cpp
|
|
|
|
engine/animation/ATranslate.h
|
|
|
|
engine/animation/AScale.h
|
|
|
|
engine/animation/ARotate.h
|
|
|
|
engine/animation/AWait.h
|
2021-10-17 19:38:16 +03:00
|
|
|
engine/animation/AFunction.h
|
2022-02-23 07:51:53 +03:00
|
|
|
engine/animation/AAttractToPoint.h
|
|
|
|
engine/animation/ARotateRelativePoint.h
|
|
|
|
engine/animation/ARotateLeft.h
|
|
|
|
engine/animation/Interpolation.cpp
|
|
|
|
engine/animation/Animations.h
|
|
|
|
engine/animation/AShowCreation.h
|
|
|
|
engine/animation/AShowUncreation.h
|
2022-07-07 13:14:00 +03:00
|
|
|
engine/animation/ARotateLeftUpLookAt.h
|
2022-07-19 13:10:18 +03:00
|
|
|
engine/animation/ADecompose.h
|
2021-09-13 15:53:43 +03:00
|
|
|
engine/physics/RigidBody.cpp
|
|
|
|
engine/physics/RigidBody.h
|
|
|
|
engine/physics/Simplex.h
|
2021-11-03 23:00:19 +03:00
|
|
|
engine/physics/HitBox.cpp
|
|
|
|
engine/physics/HitBox.h
|
2021-10-02 20:36:07 +03:00
|
|
|
engine/Object.cpp
|
2021-09-13 15:53:43 +03:00
|
|
|
engine/Object.h
|
|
|
|
engine/gui/Button.cpp
|
|
|
|
engine/gui/Button.h
|
|
|
|
engine/gui/Window.cpp
|
|
|
|
engine/gui/Window.h
|
|
|
|
engine/network/ClientUDP.cpp
|
|
|
|
engine/network/ClientUDP.h
|
|
|
|
engine/network/MsgType.cpp
|
|
|
|
engine/network/MsgType.h
|
|
|
|
engine/network/ReliableMsg.cpp
|
|
|
|
engine/network/ReliableMsg.h
|
|
|
|
engine/network/ServerUDP.cpp
|
|
|
|
engine/network/ServerUDP.h
|
|
|
|
engine/network/UDPConnection.cpp
|
|
|
|
engine/network/UDPConnection.h
|
|
|
|
engine/network/UDPSocket.cpp
|
2022-07-22 22:52:54 +03:00
|
|
|
engine/network/UDPSocket.h)
|
2021-09-13 15:53:43 +03:00
|
|
|
|
2021-09-13 17:01:26 +03:00
|
|
|
if(APPLE OR UNIX)
|
2021-09-13 15:53:43 +03:00
|
|
|
include_directories(/usr/local/include)
|
|
|
|
else()
|
2022-07-19 13:19:07 +03:00
|
|
|
set(SFML_DIR "C:/Libraries/SFML/lib/cmake/SFML")
|
2021-09-13 15:53:43 +03:00
|
|
|
set(SFML_STATIC_LIBRARIES TRUE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(SFML 2.5.1 COMPONENTS graphics audio REQUIRED)
|
|
|
|
|
|
|
|
if (SFML_FOUND)
|
|
|
|
include_directories(${SFML_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
|
2022-02-23 07:51:53 +03:00
|
|
|
target_link_libraries(${CMAKE_PROJECT_NAME} sfml-audio sfml-network sfml-graphics sfml-window sfml-system)
|
2021-10-22 19:42:32 +03:00
|
|
|
|
2021-10-30 15:23:47 +03:00
|
|
|
# OpenGL part
|
|
|
|
if (APPLE)
|
2021-10-22 19:42:32 +03:00
|
|
|
set(GLEW_H /usr/local/Cellar/glew/2.1.0/include/GL)
|
|
|
|
set(GLFW_H /usr/local/Cellar/glfw/3.2.1/include/GLFW)
|
|
|
|
include_directories(${GLEW_H} ${GLFW_H})
|
|
|
|
|
|
|
|
set(GLEW_LINK /usr/local/Cellar/glew/2.1.0/lib/libGLEW.2.1.dylib)
|
|
|
|
set(GLFW_LINK /usr/local/Cellar/glfw/3.2.1/lib/libglfw.3.dylib)
|
|
|
|
link_libraries(${OPENGL} ${GLEW_LINK} ${GLFW_LINK})
|
|
|
|
|
2022-02-23 07:51:53 +03:00
|
|
|
target_link_libraries(${CMAKE_PROJECT_NAME} "-framework OpenGL")
|
|
|
|
target_link_libraries(${CMAKE_PROJECT_NAME} "-framework GLUT")
|
2021-10-30 15:23:47 +03:00
|
|
|
elseif(UNIX)
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
find_package(GLUT REQUIRED)
|
|
|
|
|
2022-02-23 07:51:53 +03:00
|
|
|
target_link_libraries(${CMAKE_PROJECT_NAME} ${OPENGL_LIBRARIES})
|
|
|
|
target_link_libraries(${CMAKE_PROJECT_NAME} ${GLUT_LIBRARY})
|
2021-10-23 16:34:22 +03:00
|
|
|
endif()
|