summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt57
1 files changed, 39 insertions, 18 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index aed6907b..973192e9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,44 @@
# Lua support code.
ADD_SUBDIRECTORY(lua)
+SET(SRCS
+ main-gcu.c main-x11.c main-xaw.c main-sdl.c
+ z-rand.c z-util.c z-form.c z-virt.c z-term.c z-sock.c
+ variable.c tables.c plots.c util.c cave.c dungeon.c
+ melee1.c melee2.c modules.c
+ object1.c object2.c randart.c squeltch.c traps.c
+ monster1.c monster2.c monster3.c
+ xtra1.c xtra2.c skills.c powers.c gods.c
+ spells1.c spells2.c
+ status.c files.c notes.c loadsave.c
+ cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c
+ help.c
+ generate.c gen_maze.c gen_evol.c wild.c levels.c store.c bldg.c
+ cmovie.c irc.c
+ wizard2.c init2.c birth.c wizard1.c init1.c main.c
+ # Lua bits:
+ lua_bind.c script.c w_mnster.c w_player.c w_play_c.c w_z_pack.c
+ w_obj.c w_util.c w_spells.c w_quest.c w_dun.c
+)
+
+# Need a few additional source files for Windows.
+if(WIN32)
+ SET(SRCS ${SRCS} main-win.c readdib.c)
+ # Resource files require a little workaround.
+ if(MINGW)
+ # Workaround for resource compilation for mingw on CMake.
+ # See http://www.cmake.org/Bug/view.php?id=4068
+ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/angband_rc.o
+ COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR}
+ -i${CMAKE_CURRENT_SOURCE_DIR}/angband.rc
+ -o ${CMAKE_CURRENT_BINARY_DIR}/angband_rc.o)
+ SET(SRCS ${SRCS} ${CMAKE_CURRENT_BINARY_DIR}/angband_rc.o)
+ else(MINGW)
+ SET(SRCS ${SRCS} angband.rc)
+ endif(MINGW)
+endif(WIN32)
+
+
# Macro for defining tolua targets.
MACRO(TOLUA_FILE MODULE_NAME OUTPUT_FILE_NAME)
ADD_CUSTOM_COMMAND(
@@ -25,24 +63,7 @@ TOLUA_FILE(dungeon w_dun.c)
# tome executable
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lua)
-ADD_EXECUTABLE(tome main-gcu.c main-x11.c main-xaw.c main-sdl.c
- z-rand.c z-util.c z-form.c z-virt.c z-term.c z-sock.c
- variable.c tables.c plots.c util.c cave.c dungeon.c
- melee1.c melee2.c modules.c
- object1.c object2.c randart.c squeltch.c traps.c
- monster1.c monster2.c monster3.c
- xtra1.c xtra2.c skills.c powers.c gods.c
- spells1.c spells2.c
- status.c files.c notes.c loadsave.c
- cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c
- help.c
- generate.c gen_maze.c gen_evol.c wild.c levels.c store.c bldg.c
- cmovie.c irc.c
- wizard2.c init2.c birth.c wizard1.c init1.c main.c
- # Lua bits:
- lua_bind.c script.c w_mnster.c w_player.c w_play_c.c w_z_pack.c
- w_obj.c w_util.c w_spells.c w_quest.c w_dun.c
- )
+ADD_EXECUTABLE(tome ${EXECUTABLE_OPTIONS} ${SRCS})
TARGET_LINK_LIBRARIES(tome lua ${LIBS})
# Installation