From 557d6733e22ba607cea8d2335d9bf8479d32abb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 16 Mar 2011 07:35:08 +0100 Subject: [PATCH] Make the build system sane, pt. 1 - no install or packages yet --- CMakeLists.txt | 64 +- data/Memory-40d.xml => Memory-40d.xml | 0 data/Memory-ng.xml => Memory.xml | 0 data/Memory.xml | 2369 ------------------------- doc/CMakeLists.txt | 4 +- doc/Doxyfile.in | 3 +- library/CMakeLists.txt | 97 +- tools/examples/CMakeLists.txt | 51 +- tools/playground/CMakeLists.txt | 70 +- tools/supported/CMakeLists.txt | 90 +- 10 files changed, 149 insertions(+), 2599 deletions(-) rename data/Memory-40d.xml => Memory-40d.xml (100%) rename data/Memory-ng.xml => Memory.xml (100%) delete mode 100644 data/Memory.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index e4f4a0c5e..ab3466498 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,39 +1,37 @@ # main project file. use it from a build sub-folder, see COMPILE for details + +## some generic CMake magic +cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) PROJECT (dfhack) -cmake_minimum_required(VERSION 2.6) -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) -SET ( DFHACK_VERSION "0.5.5" ) +SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) # Set this to project source dir. When dfhack is used # as a submodule, CMAKE_SOURCE_DIR is not pointing to # the root where this particular CMakeLists.txt file sits. SET(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIR}) -# disable warning, autosearch -if(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) -endif(COMMAND cmake_policy) - if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") message(SEND_ERROR "In-source builds are not allowed.") -endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +endif() +## version - only set this for actual releases +SET (DFHACK_VERSION "dev" CACHE STRING "Version number of dfhack. Set to 'dev' by default. Only set for releases." ) + +## setting the build type IF(NOT DEFINED CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") -ENDIF(NOT DEFINED CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.") +ENDIF() -SET( LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack library" ) -SET( EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack tools" ) -SET( DATA_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack data (offset files)" ) -SET( DOXYGEN_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/output/doxygen CACHE PATH "Output directory for doxygen") +## put everything in one big ugly directory to make MSVC and KDevelop happy +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -OPTION(BUILD_DFHACK_DOCUMENTATION "Create doxygen documentation for developers" OFF) +OPTION(BUILD_DFHACK_DOXYGEN "Create doxygen documentation for developers" ON) OPTION(BUILD_DFHACK_EXAMPLES "Build example tools" OFF) OPTION(BUILD_DFHACK_PLAYGROUND "Build tools from the playground folder" OFF) OPTION(BUILD_DFHACK_C_BINDINGS "Build the C portion of the library" ON) -OPTION(BUILD_OFFSET_EDITOR "Build the Offset GUI editor (not ready for use)." OFF) OPTION(BUILD_DFHACK_SUPPORTED "Build the supported toold." ON) -OPTION(BUILD_DFHACK_SHM "Build the SHM." OFF) include_directories (${CMAKE_SOURCE_DIR}/library/include/) include_directories (${CMAKE_SOURCE_DIR}/library/shm/) @@ -41,26 +39,30 @@ include_directories (${CMAKE_SOURCE_DIR}/library/depends/argstream/) add_subdirectory (library) +# macro to save on typing in the tool subdirs +MACRO(DFHACK_TOOL TOOL_NAME TOOL_SOURCES) + ADD_EXECUTABLE(${TOOL_NAME} ${TOOL_SOURCES}) + TARGET_LINK_LIBRARIES(${TOOL_NAME} dfhack) + if(DEFINED LOCAL_DEPNAME) + ADD_DEPENDENCIES(${TOOL_NAME} ${LOCAL_DEPNAME}) + endif() + install(TARGETS + ${TOOL_NAME} + RUNTIME DESTINATION bin) +ENDMACRO() + IF(BUILD_DFHACK_SUPPORTED) add_subdirectory (tools/supported) -ENDIF(BUILD_DFHACK_SUPPORTED) - -IF(BUILD_OFFSET_EDITOR) - add_subdirectory (offsetedit) -ENDIF(BUILD_OFFSET_EDITOR) - -IF(BUILD_DFHACK_SHM) - add_subdirectory (library/shm) -ENDIF(BUILD_DFHACK_SHM) +ENDIF() IF(BUILD_DFHACK_EXAMPLES) add_subdirectory (tools/examples) -ENDIF(BUILD_DFHACK_EXAMPLES) +ENDIF() IF(BUILD_DFHACK_PLAYGROUND) add_subdirectory (tools/playground) -ENDIF(BUILD_DFHACK_PLAYGROUND) +ENDIF() -IF(BUILD_DFHACK_DOCUMENTATION) +IF(BUILD_DFHACK_DOXYGEN) add_subdirectory (doc) -ENDIF(BUILD_DFHACK_DOCUMENTATION) +ENDIF() diff --git a/data/Memory-40d.xml b/Memory-40d.xml similarity index 100% rename from data/Memory-40d.xml rename to Memory-40d.xml diff --git a/data/Memory-ng.xml b/Memory.xml similarity index 100% rename from data/Memory-ng.xml rename to Memory.xml diff --git a/data/Memory.xml b/data/Memory.xml deleted file mode 100644 index 381e39708..000000000 --- a/data/Memory.xml +++ /dev/null @@ -1,2369 +0,0 @@ - - - - - - 0x0 - - ==================================================================== - T R A I T S - ==================================================================== - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - - ==================================================================== - M O O D S - ==================================================================== - - - - - - - - ==================================================================== - P R O F E S S I O N S - ==================================================================== - TODO: Parse this and turn it into Profession tags. - Cross-reference with Memory-40d.xml - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 88 - 89 - 90 - - ==================================================================== - J O B S - ==================================================================== - TODO: Parse this and turn it into Job tags - - ==================================================================== - S K I L L S - ==================================================================== - 0 - 1 - 2 - 49 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 22 - 23 - 57 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 24 - 25 - 26 - 67 - 68 - 66 - 65 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 38 - 39 - 41 - 42 - 43 - 44 - 50 - 52 - 45 - 46 - 47 - 48 - 70 - 36 - 12 - 69 - 37 - 13 - 14 - 16 - 17 - 18 - 53 - 54 - 55 - 56 - 40 - 51 - 21 - 15 - 58 - 19 - 20 - 106 - 59 - 60 - 61 - 62 - 63 - 64 - - ==================================================================== - L E V E L S - ==================================================================== - - - - - - - - - - - - - - - - - TODO verify level 16 and up's existence in DF2010 - - - - -1 for no cap - - ==================================================================== - L A B O R S - ==================================================================== - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - - - ==================================================================== - V -- T A B L E S - (for stonesense) - ==================================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .,:rsr, - :2;,;r2A@@5 - @2::s5A#@@@ @r. . - sd;:riXA#@@ :@@@Gir;;AS9 - Bs::sS3A#@2 @@#AhXirsS#; - iHrLr5d#@@@ .@#95sr;;rie - i*' `*@3 @@A2sr;:;r#5 - :..:rll: @@A5sr::r3@ - @Hr;iZ#@@@@ `:rr;;;;: - S@r.;i2#@@@ @s. .. - @2::ri2A@@# B@G2ir:...5i - :@r,r3X##@@ @G5sr:..,:A - .@Ar;;rSB@@# H#2sr;,..,is - .' `* ,@ASs;:..,:B - ;rr;:,..,:. - `''' - W I N D O W S - and - W I N E - - - - - 851c1190b6a7b42f2463967623d18575 - 0x4BB45F99 - - Basic things - ============ - 0x18 - 0xC - Vector layout in MSVC 9: - DWORD Allocator? - DWORD ? - DWORD ? - DWORD Start - DWORD End - DWORD AllocationEnd - - 0x1C - -
0x0165B188
- - Position and window dimensions - ============================== -
0xe32798
-
0xe60838
-
0xe60814
-
0xae82cc
- -
0x17f5ab8
- Found addresses: (next to each other!) - 0x17f5ab8 - 0x17f5ac0 - 0x17f5ac8 - 0x17f5ad0 - - GUI State - ========= -
0x146e45f
- Found addresses: - 0x146e45f - 0x185b677 - - Bogus:
0xae82cc
- -
0x017f6f38
- - Bogus:
0xae82cc
- - Map stuff - ========= -
0x016AD718
- 0x08 - 0x009A - 0x029C - 0x069c - 0x159c - 0x179c - 0x1D9C - 0x0D9c - 0x2C local features - 0x30 global features - - Map Features - ============ - WORLD + 0x54374 -
0x16AF4FC
- 0x100 - 0x34 - 0x38 - WORLD + 0x54440 -
0x16AF5C8
- 0x30 - 0x34 - - - * map size in blocks * -
0x016ad738
-
0x016ad73C
-
0x016ad740
- - * map size in tiles * -
0x016ad744
-
0x016ad748
-
0x016ad74C
- - * Suspected region coords * - WORLD + 0x525C8 -
0x016ad750
- WORLD + 0x525CC -
0x016ad754
- WORLD + 0x525D0 -
0x016ad758
- - * World size * (WORDs) -
0x016AEDD4
-
0x016AEDD6
- -
0x16AF52C
-
0x16AF574
- - - - 0x64 - 0x60 - - 0x4 vector - 0x4 vector - - Name struct - =========== - 0x0 - 0x1C - 0x38 - - Creatures - ========= -
0x0166ecc4
-
0x01470fbc
-
0x01470fb0
- - 0x0 - 0x6c - 0x88 - 0x8C - 0x90 - 0xF8 - 0xFC - 0x110 - 0x114 - 0X120 - 0X1F4 - 0X21C - 0x288 - - 0x28C - 0x290 - 0x298 - 0x29C - - 0x464 - - 0x390 - - 0x394 the skill that will be increased at the end of the mood (or not) - 0x604 seems to be indexes in the list of possible colors defined in the raws for each group - - 0x6D0 - 0x770 - 0x073C - 0x0754 - 0x830 - - Souls - ===== - 0x0 - 0x1F4 - 0x224 - 0x88 - - Job structure - ============= - 0x0 Incrementaly assigned - 0x8 seems to be just like the old occupations - 0xa4 - - Job materials - ============= - 0x0 like mood materials, 0=bars, 4=stone, 5=wood, 57=cloth, 54=leather ... - 0x2 subsubtype ? - 0x4 subtype ? - 0x8 index of material (for example, 2 is for silver) - 0x18 set only for shell / bone mood requirements ? - - - - Materials - ========= - soil, stone, metal - inorganics vector = WORLD + 0x54B7C = 0x16AFD04 -
0x16afd04
- - wood and plant matter, WORLD + 0x54B94 -
0x16afd1C
- - plant matter, WORLD + 0x54BAC -
0x16afd34
- - just wood, WORLD + 0x54BDC -
0x16afd64
- - creature types actually used for creatures, - WORLD + 0x54CD0 -
0x016AFE58
- 0x138 - 0x1A14 - 0xE0 - 0xF6 - - - - Constructions - ============= - WORLD + 0x108 -
0x165b290
- 0x14 - - Translations - ============ - WORLD + 0x54E50 -
0x016AFFD8
- WORLD + 0x54E80 -
0x016B0008
- 0x4C - - Vegetation - ========== - WORLD + 0x15184 -
0x0167030C
belal: 0x017f6d98 ... what? - 0x6C - - Buildings - ========= - WORLD + 0x14818 -
0x0166f9a0
- 0x164 - WORLD + 0x5D610 -
0x016B8798
- 0x4 - 0x20 - - Effects - ======= - - :( - - Settlements - =========== - - :( - - Hotkeys - ======= -
0x01476ecc
- 0x1C - 0x20 - 0x2C - - -
- - 23dfe141c7ea4e63ebb3c618a12b48ec - 0x4BBDF378 - - - 94641d97a0ecff6f2194e3d0b310d946 - 0x4BC3C470 - - WORLD: 0x0165c1d0 ? - - Position - ======== -
0x17f6b00
Was 0x17f5ab8 - 0x17f6b00 - 0x17f6b08 - 0x17f6b10 - - Map - === -
0x016AE760
- - * map size in blocks * -
0x016AE780
-
0x016AE784
-
0x016AE788
- - * map size in tiles * -
0x016AE78C
-
0x016AE790
-
0x016AE794
- - * Suspected region coords * -
0x016AE798
-
0x016AE79C
-
0x016AE7A0
- - * World size * (WORDs) -
0x016AFE1C
-
0x016AFE1E
- - * geology * -
0x16B0574
-
0x16B05BC
- - * features * - WORLD + 0x54374 -
0x16B0544
- WORLD + 0x54440 -
0x16B0610
- - Creatures - ========= -
0x166FD0C
-
0x01471fbc
- 0x0 - 0x6c - 0x88 - 0x8C - 0x90 - 0xF8 - 0xFC - 0x110 - 0x112 - 0x114 - 0X120 - 0X1F4 - 0X21C - - - 0x288 - 0x298 - 0x29C - 0x390 - 0x394 the skill that will be increased at the end of the mood (or not) - 0x464 - - 0x604 - 0x6D4 - 0x774 - 0x0740 - 0x0758 - 0x834 - - Castes - ====== - 0x51C - 0x654 - 0xACC - - Color Mods - ========== - 0x70 - 0x64 - 0x68 - - Body Parts - ========== - 0x0 - 0x1C - 0x44 - 0x78 - 0x90 - - Materials - ========= - soil, stone, metal - inorganics vector = WORLD + 0x54B7C = 0x16B0D4C -
0x16B0D4C
- - stuff like glass, coke, ... -
0x16BA114
- - wood and plant matter, WORLD + 0x54B94 -
0x16B0D64
- - plant matter, WORLD + 0x54BAC -
0x16B0D7C
- - just wood, WORLD + 0x54BDC -
0x16B0DAC
- - creature types actually used for creatures, WORLD + 0x54CD0 -
0x16B0EA0
- - stuff that is used somehow -
0x16BA114
- - Constructions - ============= - WORLD + 0x108 -
0x165C2D8
- - Translations - ============ - WORLD + 0x54E50 -
0x016B1020
- WORLD + 0x54E80 -
0x16B1050
- - Vegetation - ========== - WORLD + 0x15184 -
0x1671354
- - Buildings - ========= - WORLD + 0x14818 -
0x16709E8
- WORLD + 0x5D610 -
0x16B97E0
- 0x4 - 0x20 - - Descriptor colors - ================= -
0x16B9780
- 0x0 - 0x4C -
0x16B9768
this includes RVB - 0x6C floats ! - 0x70 - 0x74 -
0x16B9798
A list of all colors, including eyes and stuff - - Items - ===== -
0x166FE00
- List of offsets in the VTable : - 0x0 - 0x4 - 0x8 - 0xC - 0x238 - - 0xA0 - 0x4 - 0x8 - 0x14 - 0x14 (in the vtable) - - Time - ==== -
0x0e47e08
-
0x0e79f00
-
- - 655a895c5b90d15eb9bb71e28c6c62e5 - 0x4bf014fa -
0x167870C
-
0x1471FBC
-
0x1471FB0
- -
0x16BD0B0
-
0x16C6478
-
0x16BD0C8
-
0x16bd0e0
-
0x16bd110
-
0x16BD204
-
0x16C6478
- -
0x16BD384
-
0x16BD3B4
-
0x16C5ACC
-
0x16C5AE4
-
0x16C5AFC
-
0xE78780
-
0xEAA878
- -
0x016BAAC4
-
0x016BAAE4
-
0x016BAAE8
-
0x016BAAEC
-
0x016BAAF0
-
0x016BAAF4
-
0x016BAAF8
-
0x016BAAFC
-
0x016BAB00
-
0x016BAB04
-
0x16BC180
-
0x16BC182
-
0x16BC8D8
-
0x16BC920
-
0x16BC8A8
-
0x16BC974
- -
0x1664CD8
-
0x1679D54
-
0x16793e8
-
0x1678800
- -
0x18030fc
0x17f6b00 -
0xe640dc
0xe32798 01 -
0xe921b0
0xe60838 01 -
0xe9218c
0xe60814 01 -
0xae92c8
0xae82cc 01 - - 0x0 Why do i have to redefine this ??? -
- - 394ff63fc00fedd5df0b36e4beb589bc - 0x4c091569 -
0x014abee4
CHMOD -
0x1471FB0
BOGUS! -
0x180b10c
LOOKS O.K. -
0xe6c0dc
VERIFIED -
0xe9a1b0
VERIFIED -
0xe9a18c
VERIFIED -
0xaf12cc
VERIFIED -
0xE80780
LOOKS O.K. -
0xEB2878
LOOKS O.K. - 0x0 Why do i have to redefine this ??? - ... what? -
- - c4b7e37dafa2716e31d29110968ac64e - 0x4c0f83d5 -
0xaf12d0
-
- - 1c0b5254af1b8ff9a34b51c3f6609da3 - 0x4c1cbe4b -
0xaf32d8
0xaf12d0 -
0x180d11c
0x180b10c -
0xe6e0ec
-
0xe9c1c0
-
0xe9c19c
- map size X: 0x16c4b10 - map size Y: 0x16c4b14 -
- - a83e6b21307cf41fb54c315fa40dec86 - 0x4c1d69fe -
0x14acee8
- -
- rebase="0xD030" - - - 1a85839ab03df082974dc5629d3fbc26 - 0x4C3897C0 -
0xaff2d8
-
0x16D33CC
-
0x16D33FC
- 0x4c - - Creatures - ========= -
0x168E73C
-
0x014b9f1c
- 0X1F4 - 0x2FC - 0x4AC - 0x64c - 0x71c - 0x7Bc - 0x0788 - 0x07A0 - 0x87c -
- - 349d1ad6eda7b6c5e87f8e4726a0999a - 0x4C398089 - - - 552cfa417fd131204ebfee66aefc4adb - 0x4C496D93 -
0xB062D8
-
0xe81114
VERIFIED -
0xeAF1E8
VERIFIED -
0xeAF1C4
VERIFIED -
- - f0459165a426a9f2dd8d957e9fa7f01d - 0x4C4C32E7 -
0x18313D0
-
- .-"""-. - ' \ - |,. ,-. | _________________________ - |()L( ()| | \ \ - |,' `".| | /_ Argh !!! \ - |.___.',| ` \________________________\ - .j `--"' ` `. - / ' ' \ - / / ` `. - / / ` . - / / l | - . , L I N U X | | - ,"`. .| | - _.' ``. | `..-'l - | `.`, | `. - | `. __.j ) - |__ |--""___| ,-' - `"--...,+"""" `._,.-' - - - - - - Basic things - ============ - 0xC VERIFIED - 0x0 VERIFIED - 0x4 VERIFIED - - MAP BLOCK OFFSETS - ================= - 0x08 VERIFIED - 0x20 VERIFIED - 0x24 VERIFIED - 0x006A VERIFIED - 0x026C VERIFIED - 0x066c VERIFIED - 0x156c VERIFIED - 0x176c VERIFIED - 0x1D6C VERIFIED - 0x0D6c VERIFIED - - MAP FEATURE OFFSETS - =================== - 0x94 VERIFIED - 0x28 VERIFIED - 0x2C VERIFIED - - 0x24 VERIFIED - 0x28 VERIFIED - - values for the region structure - =============================== - 0x58 VERIFIED - 0x54 VERIFIED - geoblock offsets - ================ - 0x4 VERIFIED - 0x4 VERIFIED - - Name struct - =========== - 0x0 VERIFIED - 0x4 VERIFIED - 0x8 VERIFIED - - Creature offsets - ================ - 0x0 VERIFIED - 0x3c CHMOD - 0x40 CHMOD - 0x44 CHMOD - 0x90 BAD!! - 0x8C CHMOD - 0x90 CHMOD - 0xA4 VERIFY - 0xA6 CHMOD - 0xA8 CHMOD - 0xB4 VERIFY! - 0X144 CHMOD - 0x18C VERIFY! - 0x19C VERIFY! - 0x1A0 VERIFY! - 0x464 BAD! - 0x258 CHMOD - 0x394 VERIFY! - the skill that will be increased at the end of the mood (or not) - 0x604 BAD! - 0x6D4 BAD! - 0x51C CHMOD - 0x0500 CHMOD - 0x0758 BAD! - 0x5AC CHMOD - - Souls - ===== - 0x0 - 0x1C4 CHMOD - 0x1DC CHMOD - 0x88 BAD! - - Body Parts - ========== - 0x0 - 0x1C - 0x44 - 0x78 - 0x90 - - Job structure - ============= - 0x0 Incrementaly assigned - 0x8 seems to be just like the old occupations - 0xa4 - - Job materials - ============= - 0x0 like mood materials, 0=bars, 4=stone, 5=wood, 57=cloth, 54=leather ... - 0x2 subsubtype ? - 0x4 subtype ? - 0x8 index of material (for example, 2 is for silver) - 0x18 set only for shell / bone mood requirements ? - - Creature type offsets - ===================== - 0x60 VERIFIED - from 0.31.08 - Toad: 0xaf75b68 - Toad: rawname = 0x0 - Toad: character (not reliable) = 0x20 - Toad: caste vector = 0x60 - Toad: extract? vector = 0x18f4 - Toad: colors = 0x36 - 0x18f4 VERIFIED - 0x20 VERIFIED - 0x36 LOOKS OK - - Castes - ====== - 0x70 - 0x64 - 0x68 - 0x51C - 0xACC - 0x654 - - - - Color descriptors - ================= - 0x0 VERIFIED - 0x1C VERIFIED - 0x24 VERIFIED - 0x28 VERIFIED - 0x2C VERIFIED - - Language tables - =============== - 0x1C VERIFIED - - Constructions - ============= - 0x14 - - - - 1d759a11af258263ef5c139d6d9a3e15 - -
0x92D00C0
- - Position and window dimensions - ============================== -
0x8cd3b18
-
0x8cd3b1c
-
0x8cd3b20
-
0x8b17370
-
0x9464d6c
- - GUI State - ========= -
0x92c971c
- - Map data - ========= -
0x9322d20
WORLD + 0x52C60 - - Map Features - ============ - WORLD + 0x5487C -
0x932493C
- WORLD + 0x548F4 -
0x93249B4
- - * map size in blocks * -
0x9322d34
-
0x9322d38
-
0x9322d3C
- - * map size in tiles * -
0x9322d40
-
0x9322d44
-
0x9322d48
- - * region coords * - WORLD + 0x525C8 -
0x9322d4C
- WORLD + 0x525CC -
0x9322d50
- WORLD + 0x525D0 -
0x9322d54
- - * World size * (WORDs) - WORLD + 0x542E0 -
0x93243A0
- WORLD + 0x542E2 -
0x93243A2
- WORLD + 0x54894 -
0x9324954
- WORLD + 0x548B8 -
0x9324978
- - Creatures - ========= -
0x092E3AA0
-
0x092CB608
-
0x092CB5FC
- - Materials - ========= - soil, stone, metal - inorganics vector -
0x9324e68
0x16afd04 - - wood and plant matter -
0x9324E74
- - plant matter -
0x9324E80
- - just wood -
0x9324E98
- - creature types actually used for creatures, -
0x09324F14
- - Color descriptors - ================= -
0x9329378
VERIFIED -
0x9329390
VERIFIED - - Translations - ============ - WORLD + 0x54E50 -
0x9324fd4
- WORLD + 0x54E80 -
0x9324fec
- - Constructions - ============= - WORLD + 0x84 -
0x92D0144
0x165b290 - - Time - ==== -
0x92C9680
-
0x92C9688
- - -
- - fea3801a26538b1741f3cc9294139fca - -
0x92C60E0
MOST PROBABLY BOGUS! - - Position and window dimensions - ============================== -
0x8cc9b38
VERIFIED -
0x8cc9b3c
VERIFIED -
0x8cc9b40
VERIFIED -
0x8b0d36c
VERIFIED -
0x945ad8c
VERIFIED - GUI State - ========= -
0x92bf73c
VERIFIED - - Map data - ======== - WORLD + 0x52C60? -
0x9318D40
VERIFIED - - Map Features - ============ - WORLD + 0x5487C? -
0x931A95C
VERIFIED - WORLD + 0x548F4? -
0x931A9D4
VERIFIED - - * map size in blocks * -
0x9318D54
VERIFIED -
0x9318D58
VERIFIED -
0x9318D5C
VERIFIED - - * map size in tiles * -
0x9318D60
VERIFIED -
0x9318D64
VERIFIED -
0x9318D68
VERIFIED - - * region coords * - WORLD + 0x525C8 -
0x9318D6C
VERIFIED - WORLD + 0x525CC -
0x9318D70
VERIFIED - WORLD + 0x525D0 -
0x9318D74
VERIFIED (old = 0x9322d54) - - * World size * (WORDs) - WORLD + 0x542E0 -
0x931A3C0
VERIFIED - WORLD + 0x542E2 -
0x931A3C2
VERIFIED - WORLD + 0x54894 -
0x931A974
VERIFIED - WORLD + 0x548B8 -
0x931A998
VERIFIED - - Materials - ========= - soil, stone, metal - inorganics vector -
0x931ae88
VERIFIED - - wood and plant matter -
0x931ae94
VERIFIED - - plant matter -
0x931aea0
VERIFIED - - just wood -
0x931aeb8
VERIFIED - - creature types actually used for creatures, -
0x931af34
VERIFIED - - Color descriptors - ================= -
0x931f398
VERIFIED -
0x931f3b0
VERIFIED - - Translations - ============ - WORLD + 0x54E50 -
0x931aff4
- WORLD + 0x54E80 -
0x931b00c
- - Creatures - ========= -
0x92D9AC0
-
0x92C1628
0x092CB608 -
0x92C161C
0x092CB5FC - - Time - ==== -
0x92BF6A0
-
0x92BF6A8
- YEAR 0x92BF6A0, WORLD - 0x6A40 - TICKS 0x92BF6A8, WORLD - 0x6A40 + 0x08 - -
- - 13a1c19e8f59b74e307e094e2a0f28c3 -
0x8b0b328
VERIFIED - WORLD = 0x92C4000 - Creatures - ========= - WORLD + 0x139E0 - 0x92d79d4 - 0x92d79e0 = real one? seems like it - 0x92d7a10 -
- - b31979551782e89c049b11db8d2d86d7 - - - e37750890350d7b9d8203879aff8fa5c - - - - - 4f1f988bc1b425d4193d3d8b7b0579a5 - stealing memory... - looking for vectors... - ------------------- - !!LANGUAGE TABLES!! - ------------------- - translation vector: 0x932bf2c - lang vector: 0x932bf14 - word table offset: 0x1c - ------------- - !!MATERIALS!! - ------------- - inorganics: - 0x932bda8 - organics: - 0x932bdb4 - trees: - 0x932bdd8 - plants: - 0x932bdc0 - color descriptors: - 0x93302b8 - Amber color:0xaf842e0 - all descriptors: - 0x93302d0 - toad-first creature types: - 0x932be54 - all creature types: - 0x932be2c - 0x932be54 - Toad: 0xb076f88 - Toad: rawname = 0x0 - Toad: character (not reliable) = 0x20 - Toad: caste vector = 0x60 - Toad: extract? vector = 0x18f4 - Toad: colors = 0x36 - - - 3e7bea269018a6fb88ef53715685aa64 - ------------------- - !!LANGUAGE TABLES!! - ------------------- - translation vector: 0x932bf2c - lang vector: 0x932bf14 - word table offset: 0x1c - ------------- - !!MATERIALS!! - ------------- - inorganics: - 0x932bda8 - organics: - 0x932bdb4 - trees: - 0x932bdd8 - plants: - 0x932bdc0 - color descriptors: - 0x93302b8 - Amber color:0xcc3a770 - all descriptors: - 0x93302d0 - toad-first creature types: - 0x932be54 - elephant-first creature types: - all creature types: - 0x932be2c - 0x932be54 - Toad: 0xc77d798 - Toad: rawname = 0x0 - Toad: character (not reliable) = 0x20 - Toad: caste vector = 0x60 - Toad: extract? vector = 0x18f4 - Toad: colors = 0x36 - - Buildings - ========= -
0x92eb068
- 0xE0 - -
0x93302e8
- 0x4 - 0x8 - - - - - - -
- - - 7b04ad536b8b657588ac209a7f95e1d1 -
0x8cf7a58
VERIFIED -
0x8cf7a5C
VERIFIED -
0x8cf7a60
VERIFIED -
0x8b3b328
VERIFIED - ------------------- - !!LANGUAGE TABLES!! - ------------------- - translation vector: 0x9348f4c - lang vector: 0x9348f34 - word table offset: 0x1c - ------------- - !!MATERIALS!! - ------------- - inorganics: - 0x9348dc8 - organics: - 0x9348dd4 - trees: - 0x9348df8 - plants: - 0x9348de0 - color descriptors: - 0x934d2d8 - Amber color:0xac014c0 - all descriptors: - 0x934d2f0 - toad-first creature types: - 0x9348e74 - all creature types: - 0x9348e4c - 0x9348e74 - Toad: 0xadae390 - Toad: rawname = 0x0 - Toad: character (not reliable) = 0x20 - Toad: caste vector = 0x60 - Toad: extract? vector = 0x18f4 - Toad: colors = 0x36 -
- - e79cead03187ecb692961b316b7cdcd4 -
0x09487970
-
-
-
- - diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 7f569fc27..75d462d31 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -10,7 +10,7 @@ # http://tobias.rautenkranz.ch/cmake/doxygen/ # but it is hard to understand... -FIND_PACKAGE(Doxygen) +FIND_PACKAGE(Doxygen QUIET) IF(DOXYGEN_FOUND) SET(DOXYGEN_LANGUAGE "English" CACHE STRING "Language used by doxygen") @@ -59,5 +59,5 @@ IF(DOXYGEN_FOUND) # INSTALL( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" DESTINATION "/usr/share/doc/dfhack-${DFHACK_VERSION}" ) ELSE(DOXYGEN_FOUND) - MESSAGE (FATAL_ERROR "doxygen binary couldn't be found") + MESSAGE (WARNING "Doxygen binary couldn't be found. Can't build development documentation.'") ENDIF(DOXYGEN_FOUND) \ No newline at end of file diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 64cb1a4de..1db63239d 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -38,7 +38,8 @@ PROJECT_NUMBER = @DFHACK_VERSION@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = @DOXYGEN_OUTPUT_DIR@ +OUTPUT_DIRECTORY = html +# @DOXYGEN_OUTPUT_DIR@ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 6fc1452fe..479c05eb0 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,23 +1,15 @@ # don't use this file directly. use the one in the root folder of the project PROJECT (dfhack-library) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) -# disable warning, autosearch -if(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) -endif(COMMAND cmake_policy) - if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") message(SEND_ERROR "In-source builds are not allowed.") -endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +endif() IF(NOT DEFINED CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") -ENDIF(NOT DEFINED CMAKE_BUILD_TYPE) - -SET( LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack library" ) -SET( EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack tools" ) +ENDIF() include_directories (${CMAKE_SOURCE_DIR}/library/include/) include_directories (${CMAKE_SOURCE_DIR}/library/shm/) @@ -159,31 +151,28 @@ modules/WindowIO-windows.cpp IF(UNIX) LIST(APPEND PROJECT_HDRS ${PROJECT_HDRS_LINUX}) LIST(APPEND PROJECT_SRCS ${PROJECT_SRCS_LINUX}) -ELSE(UNIX) +ELSE() LIST(APPEND PROJECT_HDRS ${PROJECT_HDRS_WINDOWS}) LIST(APPEND PROJECT_SRCS ${PROJECT_SRCS_WINDOWS}) -ENDIF(UNIX) +ENDIF() IF(BUILD_DFHACK_C_BINDINGS) LIST(APPEND PROJECT_HDRS ${PROJECT_C_HDRS}) LIST(APPEND PROJECT_SRCS ${PROJECT_C_SRCS}) -ENDIF(BUILD_DFHACK_C_BINDINGS) +ENDIF() SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE ) LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS}) SET( MEMXML_DATA_PATH . CACHE PATH "search path for Memory.xml") -# OPTION( VARIABLE "Description" Initial state) -#OPTION( WITH_FOO "Enable FOO support" ON ) -#OPTION( WITH_BAR "Enable BAR component" OFF ) # Are we 64bit? (Damn you, ptrace()!) IF( CMAKE_SIZEOF_VOID_P MATCHES 4 ) SET( HAVE_64_BIT 0 ) -ELSE( CMAKE_SIZEOF_VOID_P MATCHES 4 ) +ELSE() SET( HAVE_64_BIT 1 ) -ENDIF( CMAKE_SIZEOF_VOID_P MATCHES 4 ) +ENDIF() CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/library/config.h.cmake ${CMAKE_SOURCE_DIR}/library/private/config.h ) @@ -197,14 +186,13 @@ IF(UNIX) SET(CMAKE_CXX_FLAGS "-fvisibility=hidden") SET(PROJECT_LIBS ${X11_LIBRARY} rt ) #dfhack-md5 dfhack-tixml -ELSE(UNIX) +ELSE() IF(MSVC) SET(PROJECT_LIBS psapi ${CMAKE_SOURCE_DIR}/library/depends/ntdll/ntdll.lib) - ELSE(MSVC) + ELSE() SET(PROJECT_LIBS psapi ntdll) - ENDIF(MSVC) - -ENDIF(UNIX) + ENDIF() +ENDIF() ADD_LIBRARY(dfhack SHARED ${PROJECT_SRCS}) @@ -212,38 +200,41 @@ SET_TARGET_PROPERTIES(dfhack PROPERTIES DEBUG_POSTFIX "-debug" ) TARGET_LINK_LIBRARIES(dfhack ${PROJECT_LIBS}) -if(MSVC) +ADD_CUSTOM_COMMAND( TARGET dfhack POST_BUILD +COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Memory.xml ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/) + +#if(MSVC) # This is a MSVC hack used for copying files into the target directory # of build target set in MSVC. # It exploits the fact that MSVC has some variables in .vcproj files, much like cmake does here. # # So, $(TargetDir) is ignored by cmake, and replaced with the actual output directory by MSVC - ADD_CUSTOM_COMMAND(TARGET dfhack - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/data/Memory-ng.xml "$(TargetDir)/Memory.xml" - MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/data/Memory-ng.xml - ) - ADD_CUSTOM_COMMAND(TARGET dfhack - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Compile.html "$(TargetDir)/Compile.html" - MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/Compile.html - ) - ADD_CUSTOM_COMMAND(TARGET dfhack - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Readme.html "$(TargetDir)/Readme.html" - MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/Readme.html - ) - ADD_CUSTOM_COMMAND(TARGET dfhack - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/LICENSE "$(TargetDir)/LICENSE.txt" - MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/LICENSE - ) -else(MSVC) + #ADD_CUSTOM_COMMAND(TARGET dfhack + #COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/data/Memory-ng.xml "$(TargetDir)/Memory.xml" + #MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/data/Memory-ng.xml + #) + #ADD_CUSTOM_COMMAND(TARGET dfhack + #COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Compile.html "$(TargetDir)/Compile.html" + #MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/Compile.html + #) + #ADD_CUSTOM_COMMAND(TARGET dfhack + #COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Readme.html "$(TargetDir)/Readme.html" + #MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/Readme.html + #) + #ADD_CUSTOM_COMMAND(TARGET dfhack + #COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/LICENSE "$(TargetDir)/LICENSE.txt" + #MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/LICENSE + #) +#else(MSVC) # Just put the file in the output directory on Linux and Mac - configure_file(${CMAKE_SOURCE_DIR}/data/Memory-ng.xml ${DATA_OUTPUT_PATH}/Memory.xml COPYONLY) - configure_file(${CMAKE_SOURCE_DIR}/Compile.html ${DATA_OUTPUT_PATH}/Compile.html COPYONLY) - configure_file(${CMAKE_SOURCE_DIR}/Readme.html ${DATA_OUTPUT_PATH}/Readme.html COPYONLY) - configure_file(${CMAKE_SOURCE_DIR}/LICENSE ${DATA_OUTPUT_PATH}/LICENSE.txt COPYONLY) -endif(MSVC) - -IF(UNIX) - install(TARGETS dfhack LIBRARY DESTINATION lib) - install(FILES ${CMAKE_SOURCE_DIR}/output/Memory.xml DESTINATION share/dfhack) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/library/include/ DESTINATION include FILES_MATCHING PATTERN "*.h") -ENDIF(UNIX) + #configure_file(${CMAKE_SOURCE_DIR}/data/Memory-ng.xml ${DATA_OUTPUT_PATH}/Memory.xml COPYONLY) + #configure_file(${CMAKE_SOURCE_DIR}/Compile.html ${DATA_OUTPUT_PATH}/Compile.html COPYONLY) + #configure_file(${CMAKE_SOURCE_DIR}/Readme.html ${DATA_OUTPUT_PATH}/Readme.html COPYONLY) + #configure_file(${CMAKE_SOURCE_DIR}/LICENSE ${DATA_OUTPUT_PATH}/LICENSE.txt COPYONLY) +#endif(MSVC) + +#IF(UNIX) +# install(TARGETS dfhack LIBRARY DESTINATION lib) +# install(FILES ${CMAKE_SOURCE_DIR}/output/Memory.xml DESTINATION share/dfhack) +# install(DIRECTORY ${CMAKE_SOURCE_DIR}/library/include/ DESTINATION include FILES_MATCHING PATTERN "*.h") +#ENDIF(UNIX) diff --git a/tools/examples/CMakeLists.txt b/tools/examples/CMakeLists.txt index 251efe49c..0c0f66660 100644 --- a/tools/examples/CMakeLists.txt +++ b/tools/examples/CMakeLists.txt @@ -5,57 +5,42 @@ IF(UNIX) add_definitions(-DLINUX_BUILD) ENDIF(UNIX) +IF(MSVC) + ADD_CUSTOM_TARGET( memxml-for-examples + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Memory.xml ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Copying Memory.xml to ${CMAKE_CURRENT_BINARY_DIR}" + ) + set(LOCAL_DEPNAME memxml-for-examples) +ENDIF() + # buildingsdump - dump buildings and their raw data filtered by type -ADD_EXECUTABLE(dfbuildingsdump buildingsdump.cpp) -TARGET_LINK_LIBRARIES(dfbuildingsdump dfhack) +DFHACK_TOOL(dfbuildingsdump buildingsdump.cpp) # constructiondump - dump constructions! -ADD_EXECUTABLE(dfconstructiondump construction_dump.cpp) -TARGET_LINK_LIBRARIES(dfconstructiondump dfhack) +DFHACK_TOOL(dfconstructiondump construction_dump.cpp) # creaturedump - basic creature dump - a test of the creature related exports -ADD_EXECUTABLE(dfcreaturedump creaturedump.cpp) -TARGET_LINK_LIBRARIES(dfcreaturedump dfhack) +DFHACK_TOOL(dfcreaturedump creaturedump.cpp) # materialtest - just list the first material of each type -ADD_EXECUTABLE(dfmaterialtest materialtest.cpp) -TARGET_LINK_LIBRARIES(dfmaterialtest dfhack) +DFHACK_TOOL(dfmaterialtest materialtest.cpp) # itemdump - dump the item under the cursor -ADD_EXECUTABLE(dfitemdump dfitemdump.cpp) -TARGET_LINK_LIBRARIES(dfitemdump dfhack) +DFHACK_TOOL(dfitemdump dfitemdump.cpp) # hotkeynotedump - dumps the hotkeys and notes for the loaded map # Author: belal -ADD_EXECUTABLE(dfhotkeynotedump hotkeynotedump.cpp) -TARGET_LINK_LIBRARIES(dfhotkeynotedump dfhack) +DFHACK_TOOL(dfhotkeynotedump hotkeynotedump.cpp) # settlementdump - dumps the settlements on the loaded map # Author: belal -# ADD_EXECUTABLE(dfsettlementdump settlementdump.cpp) -# TARGET_LINK_LIBRARIES(dfsettlementdump dfhack) +# DFHACK_TOOL(dfsettlementdump settlementdump.cpp) # treedump - dump them trees! -ADD_EXECUTABLE(dftreedump treedump.cpp) -TARGET_LINK_LIBRARIES(dftreedump dfhack) +DFHACK_TOOL(dftreedump treedump.cpp) # spatterdump - dump spatter 'veins' -ADD_EXECUTABLE(dfspatterdump spatterdump.cpp) -TARGET_LINK_LIBRARIES(dfspatterdump dfhack) +DFHACK_TOOL(dfspatterdump spatterdump.cpp) # processenum - demonstrates the use of ProcessEnumerator -ADD_EXECUTABLE(dfprocessenum processenum.cpp) -TARGET_LINK_LIBRARIES(dfprocessenum dfhack) - -install(TARGETS -dfbuildingsdump -dfconstructiondump -dfcreaturedump -dfmaterialtest -dfitemdump -dfhotkeynotedump -dftreedump -dfspatterdump -dfprocessenum -RUNTIME DESTINATION bin -) \ No newline at end of file +DFHACK_TOOL(dfprocessenum processenum.cpp) diff --git a/tools/playground/CMakeLists.txt b/tools/playground/CMakeLists.txt index edb83f779..117f9601d 100644 --- a/tools/playground/CMakeLists.txt +++ b/tools/playground/CMakeLists.txt @@ -5,105 +5,81 @@ IF(UNIX) add_definitions(-DLINUX_BUILD) ENDIF(UNIX) +# deep magic. make sure it runs to be able to do debug runs for MSVC projects out of the box +IF(MSVC) + ADD_CUSTOM_TARGET( memxml-for-playground + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Memory.xml ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Copying Memory.xml to ${CMAKE_CURRENT_BINARY_DIR}" + ) + set(LOCAL_DEPNAME memxml-for-playground) +ENDIF() + # a creature mood dump hack. has hardcoded offsets -ADD_EXECUTABLE(dfmoodump moodump.cpp) -TARGET_LINK_LIBRARIES(dfmoodump dfhack) +DFHACK_TOOL(dfmoodump moodump.cpp) # bauxite - turn all mechanisms into bauxite mechanisms # Author: Alex Legg -#ADD_EXECUTABLE(dfbauxite dfbauxite.cpp) -#TARGET_LINK_LIBRARIES(dfbauxite dfhack) +#DFHACK_TOOL(dfbauxite dfbauxite.cpp) # digger - designate for digging by tile class # Author: mizipzor -ADD_EXECUTABLE(dfdigger digger.cpp) -TARGET_LINK_LIBRARIES(dfdigger dfhack) +DFHACK_TOOL(dfdigger digger.cpp) # digger2 - designate for digging from a text file # Author: rOut -ADD_EXECUTABLE(dfdigger2 digger2.cpp) -TARGET_LINK_LIBRARIES(dfdigger2 dfhack) - -ADD_EXECUTABLE(primitives primitives.cpp) +DFHACK_TOOL(dfdigger2 digger2.cpp) # itemdesignator - change some item designations (dump, forbid, on-fire) for all # items of a given type and material # Author: belal -#ADD_EXECUTABLE(dfitemdesignator itemdesignator.cpp) -#TARGET_LINK_LIBRARIES(dfitemdesignator dfhack) +#DFHACK_TOOL(dfitemdesignator itemdesignator.cpp) # catsplosion - Accelerates pregnancy # Author: Zhentar -ADD_EXECUTABLE(dfcatsplosion catsplosion.cpp) -TARGET_LINK_LIBRARIES(dfcatsplosion dfhack) +DFHACK_TOOL(dfcatsplosion catsplosion.cpp) # findnameindexes # Author: belal -#ADD_EXECUTABLE(dffindnameindexes findnameindexes.cpp) -#TARGET_LINK_LIBRARIES(dffindnameindexes dfhack) +#DFHACK_TOOL(dffindnameindexes findnameindexes.cpp) # renamer - change the custom names and professions of creatures, sends keys to # df directly # Author: belal -#ADD_EXECUTABLE(dfrenamer renamer.cpp) -#TARGET_LINK_LIBRARIES(dfrenamer dfhack) +#DFHACK_TOOL(dfrenamer renamer.cpp) # copypaste # Author: belal # copies the current buildings in a df map, and then designates the area to be dug # mainly a proof of concept for my gui application dfCopyPaste -ADD_EXECUTABLE(dfcopypaste copypaste.cpp) -TARGET_LINK_LIBRARIES(dfcopypaste dfhack) +DFHACK_TOOL(dfcopypaste copypaste.cpp) # paths # Author: belal # dumps the current path to the DF exe, as well as the relative paths to the # current tileset and color files -ADD_EXECUTABLE(dfpaths paths.cpp) -TARGET_LINK_LIBRARIES(dfpaths dfhack) +DFHACK_TOOL(dfpaths paths.cpp) # deramp # Author: zilpin # seeks entire map for 'remove ramp' designation, makes a floor, removes designation. # intended use is to simulate old 'channel' functionality. -ADD_EXECUTABLE(dfderamp deramp.cpp) -TARGET_LINK_LIBRARIES(dfderamp dfhack) - +DFHACK_TOOL(dfderamp deramp.cpp) # printtiletypes # Author: zilpin # Prints CSV dump of all tile type information. # No DF process needed. Intended only for debugging and information purposes. -ADD_EXECUTABLE(dfprinttiletypes printtiletypes.cpp) -TARGET_LINK_LIBRARIES(dfprinttiletypes dfhack) +DFHACK_TOOL(dfprinttiletypes printtiletypes.cpp) # hellhole # Author: zilpin # Creates a bottomless hole to hell. # Experimental version hard-codes values. # Will have many options in the future. -ADD_EXECUTABLE(dfhellhole hellhole.cpp) -TARGET_LINK_LIBRARIES(dfhellhole dfhack) - +DFHACK_TOOL(dfhellhole hellhole.cpp) # this needs the C bindings IF(BUILD_DFHACK_C_BINDINGS) # for trying out some 'stuff' - ADD_EXECUTABLE(dftest test.cpp) - TARGET_LINK_LIBRARIES(dftest dfhack) - install(TARGETS - dftest - RUNTIME DESTINATION bin - ) + DFHACK_TOOL(dftest test.cpp) ENDIF(BUILD_DFHACK_C_BINDINGS) - -install(TARGETS -dfmoodump -dfdigger -dfdigger2 -dfcatsplosion -dfderamp -dfprinttiletypes -dfhellhole -RUNTIME DESTINATION bin -) diff --git a/tools/supported/CMakeLists.txt b/tools/supported/CMakeLists.txt index d8cc6dad7..601fc3b32 100644 --- a/tools/supported/CMakeLists.txt +++ b/tools/supported/CMakeLists.txt @@ -3,84 +3,72 @@ # this is required to ensure we use the right configuration for the system. IF(UNIX) add_definitions(-DLINUX_BUILD) -ENDIF(UNIX) +ENDIF() + +IF(MSVC) + ADD_CUSTOM_TARGET( memxml-for-supported + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Memory.xml ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Copying Memory.xml to ${CMAKE_CURRENT_BINARY_DIR}") + set(LOCAL_DEPNAME memxml-for-supported) +ENDIF() # a reveal clone -ADD_EXECUTABLE(dfreveal reveal.cpp) -TARGET_LINK_LIBRARIES(dfreveal dfhack) +DFHACK_TOOL(dfreveal reveal.cpp) # force pause! -ADD_EXECUTABLE(dfpause forcepause.cpp) -TARGET_LINK_LIBRARIES(dfpause dfhack) +DFHACK_TOOL(dfpause forcepause.cpp) # prospector - produces a list of available materials and their quantities -ADD_EXECUTABLE(dfprospector prospector.cpp) -TARGET_LINK_LIBRARIES(dfprospector dfhack) +DFHACK_TOOL(dfprospector prospector.cpp) # vdig - dig the vein under the cursor -ADD_EXECUTABLE(dfvdig vdig.cpp) -TARGET_LINK_LIBRARIES(dfvdig dfhack) +DFHACK_TOOL(dfvdig vdig.cpp) # cleanmap - removes mud, snow, blood and similar stuff from a map. farmers beware -ADD_EXECUTABLE(dfcleanmap cleanmap.cpp) -TARGET_LINK_LIBRARIES(dfcleanmap dfhack) +DFHACK_TOOL(dfcleanmap cleanmap.cpp) # unstuck - make DF run if something goes wrong with the 'normal' memory access method -ADD_EXECUTABLE(dfunstuck unstuck.cpp) -TARGET_LINK_LIBRARIES(dfunstuck dfhack) +DFHACK_TOOL(dfunstuck unstuck.cpp) # probe - map tile probe -ADD_EXECUTABLE(dfprobe probe.cpp) -TARGET_LINK_LIBRARIES(dfprobe dfhack) +DFHACK_TOOL(dfprobe probe.cpp) # attachtest - 100x attach/detach, suspend/resume -ADD_EXECUTABLE(dfattachtest attachtest.cpp) -TARGET_LINK_LIBRARIES(dfattachtest dfhack) +DFHACK_TOOL(dfattachtest attachtest.cpp) # a benchmark program, reads the map 1000x -ADD_EXECUTABLE(dfexpbench expbench.cpp) -TARGET_LINK_LIBRARIES(dfexpbench dfhack) +DFHACK_TOOL(dfexpbench expbench.cpp) # suspendtest - test if suspend works. df should stop responding when suspended # by dfhack -ADD_EXECUTABLE(dfsuspend suspendtest.cpp) -TARGET_LINK_LIBRARIES(dfsuspend dfhack) +DFHACK_TOOL(dfsuspend suspendtest.cpp) # flows - check flows impact on fps -ADD_EXECUTABLE(dfflows flows.cpp) -TARGET_LINK_LIBRARIES(dfflows dfhack) +DFHACK_TOOL(dfflows flows.cpp) # liquids manipulation tool # Original author: Aleric -ADD_EXECUTABLE(dfliquids liquids.cpp) -TARGET_LINK_LIBRARIES(dfliquids dfhack) +DFHACK_TOOL(dfliquids liquids.cpp) # Solves the problem of unusable items after reclaim by clearing the 'in_job' bit of all items. # Original author: Quietust -#ADD_EXECUTABLE(dfcleartask cleartask.cpp) -#TARGET_LINK_LIBRARIES(dfcleartask dfhack) +#DFHACK_TOOL(dfcleartask cleartask.cpp) # position - check the DF window and cursor parameters -ADD_EXECUTABLE(dfposition position.cpp) -TARGET_LINK_LIBRARIES(dfposition dfhack) +DFHACK_TOOL(dfposition position.cpp) # mode - a utility to change the current game and control modes -ADD_EXECUTABLE(dfmode mode.cpp) -TARGET_LINK_LIBRARIES(dfmode dfhack) +DFHACK_TOOL(dfmode mode.cpp) # just dump offsets of the current version -ADD_EXECUTABLE(dfdoffsets dumpoffsets.cpp) -TARGET_LINK_LIBRARIES(dfdoffsets dfhack) +DFHACK_TOOL(dfdoffsets dumpoffsets.cpp) # change the weather -ADD_EXECUTABLE(dfweather weather.cpp) -TARGET_LINK_LIBRARIES(dfweather dfhack) +DFHACK_TOOL(dfweather weather.cpp) # incrementalsearch - a bit like cheat engine, only DF-specific, very basic -#ADD_EXECUTABLE(dfautosearch autosearch.cpp) -#TARGET_LINK_LIBRARIES(dfautosearch dfhack) -ADD_EXECUTABLE(dfincremental incrementalsearch.cpp) -TARGET_LINK_LIBRARIES(dfincremental dfhack) +#DFHACK_TOOL(dfautosearch autosearch.cpp) +DFHACK_TOOL(dfincremental incrementalsearch.cpp) IF(UNIX) @@ -117,27 +105,3 @@ IF(UNIX) MESSAGE(STATUS "Wide-character ncurses library not found - veinlook can't be built") ENDIF(CURSES_FOUND) ENDIF(UNIX) - - -install(TARGETS -dfmode -dfreveal -dfprospector -dfposition -dfvdig -dfcleanmap -dfunstuck -dfprobe -dfpause -dfdoffsets -dfattachtest -#dfcleartask -dfexpbench -dfsuspend -dfflows -dfliquids -dfweather -#dfautosearch -dfincremental -RUNTIME DESTINATION bin -)