I am killing the core/ directory.

Lots of files are moving to a new location in src/
Some intersting CMake changes.
This commit is contained in:
Enno Rehling 2014-02-18 05:45:00 +01:00
parent 5cf31189e6
commit 03c247c788
356 changed files with 481 additions and 431 deletions

View File

@ -41,5 +41,4 @@ add_subdirectory (storage)
add_subdirectory (iniparser) add_subdirectory (iniparser)
add_subdirectory (quicklist) add_subdirectory (quicklist)
add_subdirectory (critbit) add_subdirectory (critbit)
add_subdirectory (core/src eressea) add_subdirectory (src eressea)
add_subdirectory (src server)

View File

@ -1,13 +1,2 @@
all: bin/eressea all:
@echo "Please use the cmake build system by running configure"
bin:
mkdir bin
bin/eressea: bin/Makefile
cd bin ; make
bin/Makefile: bin
cd bin ; cmake ..
clean:
rm -rf bin

View File

@ -1,209 +0,0 @@
cmake_minimum_required(VERSION 2.6)
project (eressea C)
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
set (ERESSEA_LIBRARY eressea CACHE INTERNAL "eressea library")
set (ERESSEA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "eressea includes")
include_directories (${ERESSEA_INCLUDE_DIR})
include_directories (${CRITBIT_INCLUDE_DIR})
include_directories (${CRYPTO_INCLUDE_DIR})
include_directories (${QUICKLIST_INCLUDE_DIR})
include_directories (${STORAGE_INCLUDE_DIR})
include_directories (${CUTEST_INCLUDE_DIR})
include_directories (${LUA_INCLUDE_DIR})
include_directories (${LIBXML2_INCLUDE_DIR})
include_directories (${INIPARSER_INCLUDE_DIR})
FILE (GLOB_RECURSE LIB_HDR *.h)
set (TEST_SRC
tests.c
tests_test.c
gamecode/economy_test.c
gamecode/laws_test.c
gamecode/market_test.c
kernel/ally_test.c
kernel/battle_test.c
kernel/building_test.c
kernel/curse_test.c
kernel/equipment_test.c
kernel/item_test.c
kernel/magic_test.c
kernel/move_test.c
kernel/pool_test.c
kernel/reports_test.c
kernel/ship_test.c
kernel/spellbook_test.c
kernel/spell_test.c
util/base36_test.c
util/bsdstring_test.c
util/functions_test.c
util/umlaut_test.c
)
set (LIB_SRC
attributes/alliance.c
attributes/attributes.c
attributes/fleechance.c
attributes/follow.c
attributes/giveitem.c
attributes/gm.c
attributes/hate.c
attributes/iceberg.c
attributes/key.c
attributes/matmod.c
attributes/moved.c
attributes/movement.c
attributes/object.c
attributes/orcification.c
attributes/otherfaction.c
attributes/overrideroads.c
attributes/racename.c
attributes/raceprefix.c
attributes/reduceproduction.c
attributes/targetregion.c
eressea.c
gamecode/archetype.c
gamecode/creation.c
gamecode/creport.c
gamecode/economy.c
gamecode/give.c
gamecode/items.c
gamecode/laws.c
gamecode/market.c
gamecode/monster.c
gamecode/randenc.c
gamecode/report.c
gamecode/spy.c
gamecode/study.c
gamecode/summary.c
gamecode/xmlreport.c
gmtool.c
items/artrewards.c
items/demonseye.c
items/itemtypes.c
items/phoenixcompass.c
items/seed.c
items/speedsail.c
items/weapons.c
items/xerewards.c
kernel/alchemy.c
kernel/alliance.c
kernel/ally.c
kernel/battle.c
kernel/build.c
kernel/building.c
kernel/calendar.c
kernel/command.c
kernel/config.c
kernel/connection.c
kernel/curse.c
kernel/equipment.c
kernel/faction.c
kernel/group.c
kernel/item.c
kernel/magic.c
kernel/message.c
kernel/move.c
kernel/names.c
kernel/order.c
kernel/pathfinder.c
kernel/plane.c
kernel/player.c
kernel/pool.c
kernel/race.c
kernel/region.c
kernel/reports.c
kernel/resources.c
kernel/save.c
kernel/ship.c
kernel/skill.c
kernel/spellbook.c
kernel/spell.c
kernel/sqlite.c
kernel/teleport.c
kernel/terrain.c
kernel/unit.c
kernel/xmlreader.c
modules/arena.c
modules/autoseed.c
modules/dungeon.c
modules/gmcmd.c
modules/museum.c
modules/score.c
modules/weather.c
modules/wormhole.c
modules/xmas.c
triggers/changefaction.c
triggers/changerace.c
triggers/clonedied.c
triggers/createcurse.c
triggers/createunit.c
triggers/gate.c
triggers/giveitem.c
triggers/killunit.c
triggers/removecurse.c
triggers/shock.c
triggers/timeout.c
triggers/triggers.c
triggers/unguard.c
triggers/unitmessage.c
util/attrib.c
util/base36.c
util/bsdstring.c
util/console.c
util/crmessage.c
util/dice.c
util/event.c
util/filereader.c
util/functions.c
util/goodies.c
util/language.c
util/listbox.c
util/lists.c
util/log.c
util/message.c
util/nrmessage.c
util/parser.c
util/rand.c
util/resolve.c
util/sql.c
util/strings.c
util/translation.c
util/umlaut.c
util/unicode.c
util/xml.c
)
add_library(${ERESSEA_LIBRARY} ${LIB_SRC} ${BIND_SRC} ${LIB_HDR})
target_link_libraries(${ERESSEA_LIBRARY}
${STORAGE_LIBRARIES}
${CRITBIT_LIBRARIES}
${QUICKLIST_LIBRARIES}
${CRYPTO_LIBRARIES}
${INIPARSER_LIBRARIES}
${LIBXML2_LIBRARIES}
${SQLITE3_LIBRARIES}
${CURSES_LIBRARIES}
${LUA_LIBRARIES}
)
add_executable(test_eressea ${TEST_SRC})
target_link_libraries(test_eressea
${ERESSEA_LIBRARY}
${CUTEST_LIBRARIES}
)
add_test(eressea test_eressea)
IF (MSVC)
find_package (MSVC MODULE)
MSVC_CRT_SECURE_NO_WARNINGS (${ERESSEA_LIBRARY})
ENDIF (MSVC)
add_subdirectory(bindings)

View File

@ -1,66 +0,0 @@
cmake_minimum_required(VERSION 2.6)
project (bindings C)
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
ELSEIF(MSVC)
ELSE(CMAKE_COMPILER_IS_GNUCC)
MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
set (BINDINGS_LIBRARY ${PROJECT_NAME} CACHE INTERNAL "Eressea Lua Bindings")
find_package (Lua 5 REQUIRED)
find_package (ToLua REQUIRED)
include_directories (${STORAGE_INCLUDE_DIR})
include_directories (${TOLUA_INCLUDE_DIR})
FILE (GLOB_RECURSE BINDINGS_HDR *.h)
MACRO(ADD_LUA_MODULE MODULE_NAME FILES)
ADD_LIBRARY (${MODULE_NAME} SHARED ${FILES})
SET_TARGET_PROPERTIES(${MODULE_NAME}
PROPERTIES
PREFIX ""
)
ENDMACRO(ADD_LUA_MODULE)
MACRO(TOLUA_BINDING PKGFILE FILES)
ADD_CUSTOM_COMMAND(
OUTPUT ${PKGFILE}.c
DEPENDS ${FILES} ${PKGFILE}
COMMAND ${TOLUA_EXECUTABLE}
ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/${PKGFILE}.c ${PKGFILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
ENDMACRO(TOLUA_BINDING)
TOLUA_BINDING(process.pkg bind_process.h)
TOLUA_BINDING(eressea.pkg bind_eressea.h)
TOLUA_BINDING(settings.pkg bind_settings.h)
set (BINDINGS_SRC
process.pkg.c
eressea.pkg.c
settings.pkg.c
bind_process.c
bind_eressea.c
bind_settings.c
bind_building.c
bind_faction.c
bind_gmtool.c
bind_hashtable.c
bindings.c
bind_message.c
bind_region.c
bind_ship.c
bind_sqlite.c
bind_storage.c
bind_unit.c
helpers.c
)
add_library(${BINDINGS_LIBRARY} ${BINDINGS_SRC} ${BINDINGS_HDR})
target_link_libraries(${BINDINGS_LIBRARY} ${TOLUA_LIBRARIES})
target_link_libraries(${BINDINGS_LIBRARY} ${ERESSEA_LIBRARY})

View File

@ -9,7 +9,11 @@ ELSE(CMAKE_COMPILER_IS_GNUCC)
MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}") MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}")
ENDIF(CMAKE_COMPILER_IS_GNUCC) ENDIF(CMAKE_COMPILER_IS_GNUCC)
include_directories (${ERESSEA_INCLUDE_DIR}) find_package (Lua 5 REQUIRED)
find_package (ToLua REQUIRED)
find_package (SQLite3 REQUIRED)
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
include_directories (${CRITBIT_INCLUDE_DIR}) include_directories (${CRITBIT_INCLUDE_DIR})
include_directories (${STORAGE_INCLUDE_DIR}) include_directories (${STORAGE_INCLUDE_DIR})
include_directories (${CRYPTO_INCLUDE_DIR}) include_directories (${CRYPTO_INCLUDE_DIR})
@ -21,23 +25,90 @@ include_directories (${BSON_INCLUDE_DIR})
include_directories (${INIPARSER_INCLUDE_DIR}) include_directories (${INIPARSER_INCLUDE_DIR})
include_directories (${CURSES_INCLUDE_DIR}) include_directories (${CURSES_INCLUDE_DIR})
set (SERVER_SRC add_subdirectory(util)
races/races.c add_subdirectory(kernel)
races/dragons.c add_subdirectory(items)
races/zombies.c add_subdirectory(attributes)
races/illusion.c add_subdirectory(bindings)
main.c add_subdirectory(spells)
bindings.c add_subdirectory(triggers)
monsters.c add_subdirectory(modules)
spells/combatspells.c add_subdirectory(races)
spells/shipcurse.c
spells/regioncurse.c set(TESTS
spells/buildingcurse.c laws_test.c
spells/alp.c economy_test.c
spells/unitcurse.c market_test.c
spells/spells.c
curses.c
) )
add_executable(server ${SERVER_SRC}) set (SERVER_SRC
target_link_libraries(server ${BINDINGS_LIBRARY}) eressea.c
archetype.c
creation.c
creport.c
economy.c
give.c
items.c
laws.c
market.c
monster.c
randenc.c
report.c
spy.c
study.c
summary.c
xmlreport.c
gmtool.c
monsters.c
${BINDINGS_SRC}
${SPELLS_SRC}
${RACES_SRC}
${ITEMS_SRC}
${MODULES_SRC}
${TRIGGERS_SRC}
${ATTRIBUTES_SRC}
${KERNEL_SRC}
${UTIL_SRC}
)
add_executable(eressea ${SERVER_SRC} main.c)
target_link_libraries(eressea
${LUA_LIBRARIES}
${TOLUA_LIBRARIES}
${QUICKLIST_LIBRARIES}
${LIBXML2_LIBRARIES}
${STORAGE_LIBRARIES}
${SQLITE3_LIBRARIES}
${CRITBIT_LIBRARIES}
${CRYPTO_LIBRARIES}
${CURSES_LIBRARIES}
${INIPARSER_LIBRARIES}
)
set(SERVER_TEST_SRC
test_eressea.c
tests.c
tests_test.c
economy_test.c
market_test.c
laws_test.c
${UTIL_TESTS}
${KERNEL_TESTS}
)
add_executable(test_eressea ${SERVER_SRC} ${SERVER_TEST_SRC})
target_link_libraries(test_eressea ${CUTEST_LIBRARIES})
target_link_libraries(test_eressea
${LUA_LIBRARIES}
${TOLUA_LIBRARIES}
${QUICKLIST_LIBRARIES}
${LIBXML2_LIBRARIES}
${STORAGE_LIBRARIES}
${SQLITE3_LIBRARIES}
${CRITBIT_LIBRARIES}
${CRYPTO_LIBRARIES}
${CURSES_LIBRARIES}
${INIPARSER_LIBRARIES}
)
add_test(server test_eressea)

View File

@ -0,0 +1,28 @@
PROJECT(attributes C)
SET(_FILES
alliance.c
attributes.c
fleechance.c
follow.c
giveitem.c
gm.c
hate.c
iceberg.c
key.c
matmod.c
moved.c
movement.c
object.c
orcification.c
otherfaction.c
overrideroads.c
racename.c
raceprefix.c
reduceproduction.c
targetregion.c
)
FOREACH(_FILE ${_FILES})
LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE})
ENDFOREACH(_FILE)
SET(ATTRIBUTES_SRC ${_SOURCES} PARENT_SCOPE)

51
src/bindings/CMakeLists.txt Executable file
View File

@ -0,0 +1,51 @@
cmake_minimum_required(VERSION 2.6)
project (bindings C)
MACRO(ADD_LUA_MODULE MODULE_NAME FILES)
ADD_LIBRARY (${MODULE_NAME} SHARED ${FILES})
SET_TARGET_PROPERTIES(${MODULE_NAME}
PROPERTIES
PREFIX ""
)
ENDMACRO(ADD_LUA_MODULE)
MACRO(TOLUA_BINDING PKGFILE FILES)
ADD_CUSTOM_COMMAND(
OUTPUT ${PKGFILE}.c
DEPENDS ${FILES} ${PKGFILE}
COMMAND ${TOLUA_EXECUTABLE}
ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/${PKGFILE}.c ${PKGFILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
ENDMACRO(TOLUA_BINDING)
TOLUA_BINDING(process.pkg bind_process.h)
TOLUA_BINDING(eressea.pkg bind_eressea.h)
TOLUA_BINDING(settings.pkg bind_settings.h)
set (_FILES
process.pkg.c
eressea.pkg.c
settings.pkg.c
bind_process.c
bind_eressea.c
bind_settings.c
bind_building.c
bind_faction.c
bind_gmtool.c
bind_hashtable.c
bindings.c
bind_message.c
bind_monsters.c
bind_region.c
bind_ship.c
bind_sqlite.c
bind_storage.c
bind_unit.c
helpers.c
)
FOREACH(_FILE ${_FILES})
LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE})
ENDFOREACH(_FILE)
SET(BINDINGS_SRC ${_SOURCES} PARENT_SCOPE)

View File

@ -3,8 +3,8 @@
#include <kernel/types.h> #include <kernel/types.h>
#include "bind_gmtool.h" #include "bind_gmtool.h"
#include "../gmtool.h" #include "gmtool.h"
#include "../gmtool_structs.h" #include "gmtool_structs.h"
#include <kernel/region.h> #include <kernel/region.h>
#include <kernel/terrain.h> #include <kernel/terrain.h>

View File

@ -79,7 +79,7 @@ static int fix_familiars(struct lua_State *L)
return 0; return 0;
} }
void bind_eressea(struct lua_State *L) void bind_monsters(struct lua_State *L)
{ {
tolua_module(L, NULL, 0); tolua_module(L, NULL, 0);
tolua_beginmodule(L, NULL); tolua_beginmodule(L, NULL);

View File

@ -11,10 +11,10 @@
#include <kernel/terrain.h> #include <kernel/terrain.h>
#include <kernel/unit.h> #include <kernel/unit.h>
#include <kernel/move.h> #include <kernel/move.h>
#include <gamecode/economy.h> #include "economy.h"
#include <gamecode/laws.h> #include "laws.h"
#include <gamecode/market.h> #include "market.h"
#include <gamecode/study.h> #include "study.h"
#define PROC_LAND_REGION 0x0001 #define PROC_LAND_REGION 0x0001
#define PROC_LONG_ORDER 0x0002 #define PROC_LONG_ORDER 0x0002

View File

@ -48,12 +48,12 @@ without prior permission by the authors of Eressea.
#include <kernel/save.h> #include <kernel/save.h>
#include <kernel/spell.h> #include <kernel/spell.h>
#include <gamecode/creport.h> #include "creport.h"
#include <gamecode/economy.h> #include "economy.h"
#include <gamecode/summary.h> #include "summary.h"
#include <gamecode/laws.h> #include "laws.h"
#include <gamecode/monster.h> #include "monster.h"
#include <gamecode/market.h> #include "market.h"
#include <modules/autoseed.h> #include <modules/autoseed.h>
#include <modules/score.h> #include <modules/score.h>

View File

@ -1,4 +1,4 @@
$#include <bindings/bind_eressea.h> $#include "bind_eressea.h"
module eressea { module eressea {
void eressea_free_game @ free_game(void); void eressea_free_game @ free_game(void);

View File

@ -29,7 +29,7 @@ without prior permission by the authors of Eressea.
#include <kernel/item.h> #include <kernel/item.h>
#include <kernel/region.h> #include <kernel/region.h>
#include <gamecode/archetype.h> #include "archetype.h"
#include <tolua.h> #include <tolua.h>
#include <lua.h> #include <lua.h>

View File

@ -1,4 +1,4 @@
$#include <bindings/bind_process.h> $#include "bind_process.h"
module eressea { module eressea {
module process { module process {

View File

@ -1,4 +1,4 @@
$#include <bindings/bind_settings.h> $#include "bind_settings.h"
module eressea { module eressea {
module settings { module settings {

View File

@ -22,13 +22,13 @@
#include <modules/wormhole.h> #include <modules/wormhole.h>
#include <modules/gmcmd.h> #include <modules/gmcmd.h>
#include <modules/xmas.h> #include <modules/xmas.h>
#include <gamecode/archetype.h>
#include <gamecode/report.h>
#include <gamecode/items.h>
#include <gamecode/creport.h>
#include <gamecode/xmlreport.h>
#include <items/itemtypes.h> #include <items/itemtypes.h>
#include <attributes/attributes.h> #include <attributes/attributes.h>
#include "archetype.h"
#include "report.h"
#include "items.h"
#include "creport.h"
#include "xmlreport.h"
void game_done(void) void game_done(void)
{ {

Some files were not shown because too many files have changed in this diff Show More