Link based on the path the executable is in.
This commit is contained in:
@@ -32,9 +32,18 @@ CPMAddPackage(
|
||||
GIT_TAG 0.9.9.8
|
||||
)
|
||||
|
||||
#Move all libraries to lib after building.
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
||||
|
||||
#Copy the assets to the build directory.
|
||||
file(COPY "assets" DESTINATION "${PROJECT_BINARY_DIR}")
|
||||
file(COPY "cfg" DESTINATION "${PROJECT_BINARY_DIR}")
|
||||
|
||||
CPMAddPackage(
|
||||
NAME ReWindowLibrary
|
||||
NAME ReWindow
|
||||
URL https://git.redacted.cc/Redacted/ReWindow/archive/vA0.2.2.zip
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/external/ReWindow
|
||||
)
|
||||
|
||||
CPMAddPackage(
|
||||
@@ -47,13 +56,8 @@ CPMAddPackage(
|
||||
URL https://git.redacted.cc/josh/j3ml/archive/pre-1.zip
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
#${glm_SOURCE_DIR}
|
||||
${ReWindowLibrary_SOURCE_DIR}/include
|
||||
${ReHardwareID_SOURCE_DIR}/include
|
||||
${J3ML_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
|
||||
add_library(Re3D SHARED ${SOURCES})
|
||||
# Why god???
|
||||
set_target_properties(Re3D PROPERTIES LINKER_LANGUAGE CXX)
|
||||
@@ -61,5 +65,17 @@ set_target_properties(Re3D PROPERTIES LINKER_LANGUAGE CXX)
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
add_executable(Re3D_Demo "include/demo/main.cpp")
|
||||
#Link based on the relative path *so you can copy the game around*
|
||||
set_target_properties(Re3D_Demo PROPERTIES LINK_FLAGS "-Wl,-rpath,./lib")
|
||||
|
||||
include_directories(
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
#${glm_SOURCE_DIR}
|
||||
${ReWindow_SOURCE_DIR}/include
|
||||
${ReHardwareID_SOURCE_DIR}/include
|
||||
${J3ML_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
target_link_libraries(Re3D_Demo PUBLIC Re3D ReWindowLibrary ReHardwareID J3ML ${OPENGL_LIBRARIES})
|
||||
|
||||
|
||||
target_link_libraries(Re3D_Demo PUBLIC Re3D ReWindowLibrary ReHardwareID J3ML ${OPENGL_LIBRARIES})
|
@@ -1,7 +1,6 @@
|
||||
#include <thread>
|
||||
#include "engine/render.h"
|
||||
|
||||
|
||||
class App
|
||||
{
|
||||
public:
|
||||
|
@@ -19,7 +19,7 @@ void pre_render() {
|
||||
// TODO:
|
||||
getCamera()->position = {0.0f,-2.0f,-5.0f};
|
||||
getCamera()->angle.yaw = 0.0f;
|
||||
getCamera()->scriptedMove.load("../assets/scriptedMove/default.smov");
|
||||
getCamera()->scriptedMove.load("assets/scriptedMove/default.smov");
|
||||
auto* skybox = new Skybox();
|
||||
skybox->draw = true;
|
||||
storeEntity(skybox);
|
||||
|
@@ -36,7 +36,7 @@ public:
|
||||
// PLACEHOLDER LOL.
|
||||
// William continues to load assets on the first frame.
|
||||
if (engine->frameCount == 1) {
|
||||
geometry.load("../assets/models/cube.obj");
|
||||
geometry.load("assets/models/cube.obj");
|
||||
geometry.scale(0.25f);
|
||||
position = {0,-2,0};
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ public:
|
||||
void pre_render() {
|
||||
//PLACEHOLDER.
|
||||
if (engine->frameCount == 1) {
|
||||
geometry.load("../assets/models/cube.obj");
|
||||
geometry.load("assets/models/cube.obj");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -107,7 +107,7 @@ void Engine::takeScreenshot() const {
|
||||
}
|
||||
|
||||
void Engine::loadConfig() {
|
||||
std::ifstream file("../cfg/engine.cfg");
|
||||
std::ifstream file("cfg/engine.cfg");
|
||||
if (!file.is_open()) {
|
||||
std::cerr << "Couldn't load engine config." << std::endl;
|
||||
this->quit();
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#include <types/entity.h>
|
||||
#include <glm/vec3.hpp>
|
||||
#include <types/vector.h>
|
||||
|
||||
inline glm::vec3 Entity::GetPos() const
|
||||
{ return glm::vec3(coordinates[1]); }
|
||||
|
Reference in New Issue
Block a user