Make the build system sane, pt. 1 - no install or packages yet

develop
Petr Mrázek 2011-03-16 07:35:08 +01:00
parent 115a256ff5
commit 557d6733e2
10 changed files with 149 additions and 2599 deletions

@ -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()

File diff suppressed because it is too large Load Diff

@ -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)

@ -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

@ -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)

@ -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
)
DFHACK_TOOL(dfprocessenum processenum.cpp)

@ -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
)

@ -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
)