Configure project PlanetExplorerGameDemo
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
cmake_minimum_required(VERSION 3.31)
|
||||
|
||||
#project name
|
||||
project(DemoProject)
|
||||
project(PlanetExplorerGameDemo)
|
||||
|
||||
#cpp settings
|
||||
find_program(CLANG_C NAMES clang)
|
||||
@@ -34,19 +34,19 @@ find_package(Lua 5.4 REQUIRED)
|
||||
|
||||
#source files
|
||||
file(GLOB CPP_SOURCE
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/src/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*/*/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/src/*.c"
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*.c"
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*/*.c"
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*/*/*.c"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src/*/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src/*/*/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src/*/*/*/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src/*.c"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src/*/*.c"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src/*/*/*.c"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src/*/*/*/*.c"
|
||||
)
|
||||
|
||||
#includes
|
||||
include_directories(${PROJECT_SOURCE_DIR}/DemoProject/src)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/DemoProject/include)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/src)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/include)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Math/src)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Core/src)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Core/include)
|
||||
@@ -62,9 +62,9 @@ include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_GlfwOpenGlImpl/src)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_GlfwOpenGlImpl/include)
|
||||
|
||||
#project def
|
||||
add_executable(DemoProject ${CPP_SOURCE})
|
||||
add_executable(PlanetExplorerGameDemo ${CPP_SOURCE})
|
||||
|
||||
target_include_directories(DemoProject PRIVATE ${LUA_INCLUDE_DIR})
|
||||
target_include_directories(PlanetExplorerGameDemo PRIVATE ${LUA_INCLUDE_DIR})
|
||||
|
||||
if (WIN32)
|
||||
if(DEBUG)
|
||||
@@ -95,7 +95,7 @@ else()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(DemoProject PUBLIC
|
||||
target_link_libraries(PlanetExplorerGameDemo PUBLIC
|
||||
TSE_Base
|
||||
TSE_Math
|
||||
TSE_Core
|
||||
@@ -104,7 +104,7 @@ if (WIN32)
|
||||
TSE_Editor
|
||||
${LIB_SOURCE})
|
||||
else()
|
||||
target_link_libraries(DemoProject PUBLIC
|
||||
target_link_libraries(PlanetExplorerGameDemo PUBLIC
|
||||
TSE_Editor
|
||||
TSE_GlfwOpenGlImpl
|
||||
TSE_GlfwImpl
|
||||
@@ -115,15 +115,15 @@ else()
|
||||
endif()
|
||||
|
||||
#flags
|
||||
target_compile_options(DemoProject PRIVATE -march=native)
|
||||
target_compile_options(PlanetExplorerGameDemo PRIVATE -march=native)
|
||||
|
||||
set(TARGET_DIR "${PROJECT_SOURCE_DIR}/bin")
|
||||
|
||||
add_custom_command(
|
||||
TARGET DemoProject
|
||||
TARGET PlanetExplorerGameDemo
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${PROJECT_SOURCE_DIR}/DemoProject/Resources"
|
||||
"${PROJECT_SOURCE_DIR}/PlanetExplorerGameDemo/Resources"
|
||||
"${TARGET_DIR}"
|
||||
COMMENT "📂 Kopiere Resources/ nach bin/ nach Buildabschluss\n"
|
||||
)
|
||||
@@ -1,3 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#define PROJECT_NAME "DemoProject"
|
||||
|
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
3
PlanetExplorerGameDemo/include/globalVars.hpp
Normal file
3
PlanetExplorerGameDemo/include/globalVars.hpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#define PROJECT_NAME "PlanetExplorerGameDemo"
|
||||
@@ -25,13 +25,13 @@ fi
|
||||
# -----------------------------
|
||||
# Ordner umbenennen
|
||||
# -----------------------------
|
||||
if [ ! -d "__Project_Name__" ]; then
|
||||
echo "Placeholder directory '__Project_Name__' not found."
|
||||
if [ ! -d "DemoProject" ]; then
|
||||
echo "Placeholder directory 'DemoProject' not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Renaming project directory..."
|
||||
mv "__Project_Name__" "$PROJECT_NAME"
|
||||
mv "DemoProject" "$PROJECT_NAME"
|
||||
|
||||
# -----------------------------
|
||||
# CMakeLists.txt anpassen
|
||||
@@ -42,7 +42,7 @@ if [ ! -f "CMakeLists.txt" ]; then
|
||||
fi
|
||||
|
||||
echo "Updating CMakeLists.txt..."
|
||||
sed -i "s/__Project_Name__/$PROJECT_NAME/g" CMakeLists.txt
|
||||
sed -i "s/DemoProject/$PROJECT_NAME/g" CMakeLists.txt
|
||||
|
||||
# -----------------------------
|
||||
# globalVars.hpp anpassen
|
||||
@@ -55,7 +55,7 @@ if [ ! -f "$GLOBAL_VARS_PATH" ]; then
|
||||
fi
|
||||
|
||||
echo "Updating globalVars.hpp..."
|
||||
sed -i "s/__Project_Name__/$PROJECT_NAME/g" "$GLOBAL_VARS_PATH"
|
||||
sed -i "s/DemoProject/$PROJECT_NAME/g" "$GLOBAL_VARS_PATH"
|
||||
|
||||
# -----------------------------
|
||||
# Git Submodule aktualisieren
|
||||
|
||||
Reference in New Issue
Block a user