reestructuració
This commit is contained in:
@@ -26,8 +26,9 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -ffunction-sections
|
||||
# Define el directorio de los archivos fuente
|
||||
set(DIR_SOURCES "${CMAKE_SOURCE_DIR}/source")
|
||||
|
||||
# Cargar todos los archivos fuente en DIR_SOURCES
|
||||
file(GLOB SOURCES "${DIR_SOURCES}/*.cpp")
|
||||
# Cargar todos los archivos fuente en DIR_SOURCES (recursivo, sin external/)
|
||||
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "${DIR_SOURCES}/*.cpp")
|
||||
list(FILTER SOURCES EXCLUDE REGEX "${DIR_SOURCES}/external/.*")
|
||||
|
||||
# Verificar si se encontraron archivos fuente
|
||||
if(NOT SOURCES)
|
||||
@@ -57,6 +58,9 @@ endif()
|
||||
# Añadir ejecutable principal
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
|
||||
# Includes relatius a source/ (p.e. `#include "core/rendering/texture.h"`)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${DIR_SOURCES})
|
||||
|
||||
# Configuración de salida: el ejecutable principal va a la raíz del proyecto.
|
||||
# Per-target (no global) perquè `pack_resources` acabe a `build/` com la resta
|
||||
# de projectes.
|
||||
@@ -204,7 +208,7 @@ endif()
|
||||
if(NOT EMSCRIPTEN)
|
||||
add_executable(pack_resources EXCLUDE_FROM_ALL
|
||||
tools/pack_resources/pack_resources.cpp
|
||||
source/resource_pack.cpp
|
||||
source/core/resources/resource_pack.cpp
|
||||
)
|
||||
target_include_directories(pack_resources PRIVATE "${CMAKE_SOURCE_DIR}/source")
|
||||
target_compile_options(pack_resources PRIVATE -Wall)
|
||||
|
||||
Reference in New Issue
Block a user