Skip to content

Commit ba5274a

Browse files
committed
Clean up cmakelists
1 parent fcd05d3 commit ba5274a

File tree

3 files changed

+6
-29
lines changed

3 files changed

+6
-29
lines changed

CMakeLists.txt

+6-25
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,16 @@ set(LIBRARIES_DIR "lib")
77

88
include(ExternalProject)
99

10-
# get GLFW
10+
ExternalProject_Add(GLFW URL "https://github.com/glfw/glfw/archive/3.2.1.tar.gz" PREFIX "${DL_LIBRARIES_DIR}/install/glfw" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${DL_LIBRARIES_DIR}/glfw")
11+
ExternalProject_Add(GLM URL "https://github.com/g-truc/glm/archive/0.9.9.0.tar.gz" PREFIX "${DL_LIBRARIES_DIR}/install/glm" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${DL_LIBRARIES_DIR}/glm")
1112

12-
ExternalProject_Add(GLFW URL "https://github.com/glfw/glfw/archive/3.2.1.tar.gz" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${DL_LIBRARIES_DIR}/_glfw_install")
13-
ExternalProject_Add(GLM URL "https://github.com/g-truc/glm/archive/0.9.9.0.tar.gz" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${DL_LIBRARIES_DIR}/_glm_install")
14-
ExternalProject_Add(DISCORD_RPC URL "https://github.com/discordapp/discord-rpc/archive/v3.3.0.tar.gz" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${DL_LIBRARIES_DIR}/_discord_rpc_install")
13+
include_directories("${DL_LIBRARIES_DIR}/glm/include")
1514

16-
# Including GLM (old)
17-
#add_subdirectory("${CMAKE_BINARY_DIR}/GLM-prefix/src/GLM")
18-
#include_directories("${CMAKE_BINARY_DIR}/GLM-prefix/src/GLM/glm")
15+
add_executable(${PROJECT_NAME} main.cpp main.hpp engine/core/display.cpp engine/core/display.hpp engine/gl/VertexBuffer.cpp engine/gl/VertexBuffer.hpp engine/gl/VertexArray.cpp engine/gl/VertexArray.hpp engine/gl/Uniform.cpp engine/gl/Uniform.hpp engine/shader/ShaderProgram.cpp engine/shader/ShaderProgram.hpp engine/shader/impl/StaticShader.cpp engine/shader/impl/StaticShader.hpp engine/core/timer.cpp engine/core/timer.hpp engine/core/loader.cpp engine/core/loader.hpp engine/lib/pico.cpp engine/lib/pico.hpp engine/scene/Model.cpp engine/scene/Model.hpp engine/scene/Texture.cpp engine/scene/Texture.hpp engine/scene/Light.cpp rebound/terrain/marching.cpp rebound/terrain/marching.hpp rebound/terrain/Biome.cpp rebound/terrain/Biome.hpp rebound/terrain/Terrain.cpp rebound/terrain/Terrain.hpp engine/core/util.cpp engine/core/util.hpp engine/lib/OpenSimplexNoise.hpp rebound/res/OBJModels.hpp rebound/res/OBJModels.cpp)
1916

20-
include_directories("${DL_LIBRARIES_DIR}/_glm_install/include")
21-
22-
add_executable(${PROJECT_NAME} main.cpp main.hpp engine/core/display.cpp engine/core/display.hpp engine/gl/VertexBuffer.cpp engine/gl/VertexBuffer.hpp engine/gl/VertexArray.cpp engine/gl/VertexArray.hpp engine/gl/Uniform.cpp engine/gl/Uniform.hpp engine/shader/ShaderProgram.cpp engine/shader/ShaderProgram.hpp engine/shader/impl/StaticShader.cpp engine/shader/impl/StaticShader.hpp engine/core/timer.cpp engine/core/timer.hpp engine/core/loader.cpp engine/core/loader.hpp engine/lib/pico.cpp engine/lib/pico.hpp engine/scene/Model.cpp engine/scene/Model.hpp engine/scene/Texture.cpp engine/scene/Texture.hpp engine/scene/Light.cpp rebound/terrain/marching.cpp rebound/terrain/marching.hpp rebound/terrain/Biome.cpp rebound/terrain/Biome.hpp rebound/terrain/Terrain.cpp rebound/terrain/Terrain.hpp engine/core/util.cpp engine/core/util.hpp engine/lib/OpenSimplexNoise.hpp rebound/res/OBJModels.hpp rebound/res/OBJModels.cpp engine/core/discord.cpp engine/core/discord.hpp)
23-
24-
# Linking
25-
message(STATUS ${GLM_LIBRARIES})
26-
message(STATUS HELLOTHERE)
27-
#target_link_libraries(${PROJECT_NAME} "glm" ${GLM_LIBRARIES})
28-
29-
# Include GLFW
30-
target_include_directories(${PROJECT_NAME} PRIVATE "${DL_LIBRARIES_DIR}/_glfw_install/include")
31-
if (WIN32)
32-
target_link_libraries(${PROJECT_NAME} "${CMAKE_BINARY_DIR}/dl_lib/_glfw_install/lib/glfw3.lib")
33-
endif()
34-
35-
# Include DiscordRPC
36-
target_include_directories(${PROJECT_NAME} PRIVATE "${DL_LIBRARIES_DIR}/_discord_rpc_install/include")
17+
target_include_directories(${PROJECT_NAME} PRIVATE "${DL_LIBRARIES_DIR}/glfw/include")
3718
if (WIN32)
38-
target_link_libraries(${PROJECT_NAME} "${CMAKE_BINARY_DIR}/dl_lib/_discord_rpc_install/lib/discord-rpc.lib")
19+
target_link_libraries(${PROJECT_NAME} "${CMAKE_BINARY_DIR}/dl_lib/glfw/lib/glfw3.lib")
3920
endif()
4021

4122
# gl3w

main.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ int main()
3232

3333
biomes::init();
3434

35-
core::initDiscord();
36-
3735
glm::vec3 skyColor(227 / 256.0f, 168 / 256.0f, 87 / 256.0f);
3836

3937
// TODO: improve rendering system
@@ -124,7 +122,6 @@ int main()
124122
terrain.del();
125123
}
126124

127-
core::shutdownDiscord();
128125
core::destroyDisplay();
129126

130127
std::cout << "Goodbye..." << std::endl;

main.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "rebound/terrain/Terrain.hpp"
2020
#include "rebound/res/OBJModels.hpp"
2121
#include <ctime>
22-
#include "engine/core/discord.hpp"
2322

2423
void update(float delta);
2524
void render(float alpha);

0 commit comments

Comments
 (0)