Я пересоздал репозиторий из-за большого количества мусора в прошлом
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
file(GLOB_RECURSE SRC "*.cpp" "*.c" "*.h" "*.hpp")
|
||||
|
||||
add_executable(ProjectGenerator ${SRC})
|
||||
@@ -0,0 +1,32 @@
|
||||
project(${GAME_NAME})
|
||||
|
||||
file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c" "src/*.h" "src/*.hpp")
|
||||
|
||||
add_executable(${GAME_NAME} ${SRC})
|
||||
|
||||
target_link_directories(${GAME_NAME} PRIVATE
|
||||
$<$<CONFIG:Debug>:$ENV{UwU_Engine}/bin/Debug>
|
||||
$<$<CONFIG:Release>:$ENV{UwU_Engine}/bin/Release>
|
||||
)
|
||||
|
||||
target_link_libraries(${GAME_NAME} PRIVATE Core FastRTTI)
|
||||
target_include_directories(${GAME_NAME} PRIVATE
|
||||
$ENV{UwU_Engine}/include/Core
|
||||
$ENV{UwU_Engine}/include/FastRTTI
|
||||
$ENV{UwU_Engine}/include/Delegate
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
set(OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
|
||||
else()
|
||||
set(OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${GAME_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/main_config.conf
|
||||
${OUTPUT_PATH}/main_config.conf
|
||||
COMMENT "Copying main config file"
|
||||
)
|
||||
@@ -0,0 +1,32 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <cstdlib>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string project_name;
|
||||
std::cout << "Enter project name: ";
|
||||
std::getline(std::cin, project_name);
|
||||
|
||||
std::filesystem::create_directory(project_name);
|
||||
std::filesystem::create_directory(project_name + "/Resources");
|
||||
std::filesystem::create_directory(project_name + "/Worlds");
|
||||
std::filesystem::create_directory(project_name + "/src");
|
||||
|
||||
std::ifstream data("ProjectFile.txt");
|
||||
std::string buffer = "cmake_minimum_required(VERSION 3.14)\nset(GAME_NAME " + project_name + ")\n";
|
||||
|
||||
std::string line;
|
||||
while (std::getline(data, line))
|
||||
buffer += line + '\n';
|
||||
data.close();
|
||||
|
||||
std::ofstream out(project_name + "/CMakeLists.txt", std::ios::out);
|
||||
out << buffer;
|
||||
out.close();
|
||||
|
||||
std::cout << "Project created successfully!\n";
|
||||
system("pause");
|
||||
}
|
||||
Reference in New Issue
Block a user