dfhack/plugins/CMakeLists.txt

190 lines
7.6 KiB
CMake

INCLUDE(Plugins.cmake)
2012-07-08 17:05:40 -06:00
OPTION(BUILD_STONESENSE "Build stonesense (needs a checkout first)." OFF)
if(BUILD_STONESENSE)
add_subdirectory (stonesense)
endif()
2013-03-30 03:57:37 -06:00
OPTION(BUILD_ISOWORLD "Build isoworld (needs a checkout first)." OFF)
if(BUILD_ISOWORLD)
add_subdirectory (isoworld)
IF(UNIX)
if (APPLE)
#TODO: add an OSX runner script
else()
# On linux, copy our version of the df launch script which sets LD_PRELOAD
install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/runisoworld
DESTINATION .)
endif()
ENDIF()
2013-03-30 03:57:37 -06:00
endif()
2011-08-07 16:55:17 -06:00
OPTION(BUILD_DEV_PLUGINS "Build developer plugins." OFF)
if(BUILD_DEV_PLUGINS)
add_subdirectory (devel)
endif()
OPTION(BUILD_RUBY "Build ruby binding." ON)
2012-03-21 11:49:50 -06:00
if (BUILD_RUBY)
add_subdirectory (ruby)
endif()
install(DIRECTORY lua/
DESTINATION ${DFHACK_LUA_DESTINATION}/plugins
FILES_MATCHING PATTERN "*.lua")
install(DIRECTORY raw/
DESTINATION ${DFHACK_DATA_DESTINATION}/raw
FILES_MATCHING PATTERN "*.txt")
install(DIRECTORY raw/
DESTINATION ${DFHACK_DATA_DESTINATION}/raw
FILES_MATCHING PATTERN "*.diff")
# Protobuf
FILE(GLOB PROJECT_PROTOS ${CMAKE_CURRENT_SOURCE_DIR}/proto/*.proto)
STRING(REPLACE ".proto" ".pb.cc" PROJECT_PROTO_SRCS "${PROJECT_PROTOS}")
STRING(REPLACE ".proto" ".pb.h" PROJECT_PROTO_HDRS "${PROJECT_PROTOS}")
STRING(REPLACE "/proto/" "/proto/tmp/" PROJECT_PROTO_TMP_FILES "${PROJECT_PROTO_SRCS};${PROJECT_PROTO_HDRS}")
SET_SOURCE_FILES_PROPERTIES(${PROJECT_PROTO_SRCS} ${PROJECT_PROTO_HDRS}
PROPERTIES GENERATED TRUE)
# Force a re-gen if any *.pb.* files are missing
# (only runs when cmake is run, but better than nothing)
FOREACH(file IN LISTS PROJECT_PROTO_SRCS PROJECT_PROTO_HDRS)
IF(NOT EXISTS ${file})
# MESSAGE("Resetting generate_proto because '${file}' is missing")
FILE(REMOVE ${PROJECT_PROTO_TMP_FILES})
BREAK()
ENDIF()
ENDFOREACH()
ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_PROTO_TMP_FILES}
COMMAND protoc-bin -I=${dfhack_SOURCE_DIR}/library/proto/
-I=${CMAKE_CURRENT_SOURCE_DIR}/proto/
--cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/proto/tmp/
${PROJECT_PROTOS}
COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/depends/copy-if-different.pl
${PROJECT_PROTO_TMP_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/proto/
COMMENT "Generating plugin protobufs"
DEPENDS protoc-bin ${PROJECT_PROTOS}
)
ADD_CUSTOM_TARGET(generate_proto DEPENDS ${PROJECT_PROTO_TMP_FILES})
SET_SOURCE_FILES_PROPERTIES( Brushes.h PROPERTIES HEADER_FILE_ONLY TRUE )
ADD_LIBRARY(buildingplan-lib STATIC buildingplan-lib.cpp)
2015-10-18 15:46:37 -06:00
TARGET_LINK_LIBRARIES(buildingplan-lib dfhack)
# Plugins
2012-02-21 10:19:17 -07:00
OPTION(BUILD_SUPPORTED "Build the supported plugins (reveal, probe, etc.)." ON)
if (BUILD_SUPPORTED)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(3dveins 3dveins.cpp)
DFHACK_PLUGIN(add-spatter add-spatter.cpp)
#DFHACK_PLUGIN(advtools advtools.cpp)
DFHACK_PLUGIN(autochop autochop.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(autodump autodump.cpp)
DFHACK_PLUGIN(autogems autogems.cpp LINK_LIBRARIES jsoncpp_lib_static)
DFHACK_PLUGIN(autohauler autohauler.cpp)
2014-08-15 13:12:57 -06:00
DFHACK_PLUGIN(autolabor autolabor.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(automaterial automaterial.cpp)
2014-06-04 04:12:30 -06:00
DFHACK_PLUGIN(automelt automelt.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(autotrade autotrade.cpp)
DFHACK_PLUGIN(blueprint blueprint.cpp LINK_LIBRARIES lua)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(burrows burrows.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(building-hacks building-hacks.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(buildingplan buildingplan.cpp LINK_LIBRARIES buildingplan-lib)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(changeitem changeitem.cpp)
DFHACK_PLUGIN(changelayer changelayer.cpp)
DFHACK_PLUGIN(changevein changevein.cpp)
DFHACK_PLUGIN(cleanconst cleanconst.cpp)
2012-02-21 10:19:17 -07:00
DFHACK_PLUGIN(cleaners cleaners.cpp)
DFHACK_PLUGIN(cleanowned cleanowned.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(command-prompt command-prompt.cpp)
DFHACK_PLUGIN(confirm confirm.cpp LINK_LIBRARIES lua)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(createitem createitem.cpp)
DFHACK_PLUGIN(cursecheck cursecheck.cpp)
Merge branch cxxrandom Implements helper functions for random number generation. Implemented using C++11 <random> library. Exported Lua Functions: - seedRNG(seed) - rollInt(min, max) - rollDouble(min, max) - rollNormal(mean, std_deviation) - rollBool(chance_for_true) - resetIndexRolls(string, array_length) --String identifies the instance of SimpleNumDistribution to reset - rollIndex(string, array_length) --String identifies the instance of SimpleNumDistribution to use --(Shuffles a vector of indices, Next() increments through then reshuffles when end() is reached) On branch cxxrandom-rel Changes to be committed: modified: plugins/CMakeLists.txt new file: plugins/cxxrandom.cpp new file: plugins/lua/cxxrandom.lua ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Squashed commit of the following: commit 3a7ef70d45f3e0c2fe367141dd0349dddaaff60d Merge: fd9f1982 7aa0608c Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Fri Dec 22 22:17:27 2017 -0800 Merge remote-tracking branch 'origin/temp' into cxxrandom commit 7aa0608cb85dcf82686193db7a6e9d1318f5f2a5 Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Thu Dec 21 21:43:35 2017 -0800 Revises cxxrandom plugin New functions: - seedRNG(ushort seed) --lua exported - GetDistribContainer() --internal singleton - RNG() --internal singleton Summary: - Removed class CXXRNG --Refactored functions that used CXXRNG Changes to be committed: modified: plugins/cxxrandom.cpp commit b42979818a01c1121eace7b1ac14676f5ad5d8b2 Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Wed Dec 20 13:21:49 2017 -0800 Fixes plugin_init() Misread the lines indicated by lethosor to be excluded, had broken the plugin in the process. Changes to be committed: modified: plugins/cxxrandom.cpp commit 753a00a14d9e6519d299638e014abf30509940af Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Wed Dec 20 12:36:17 2017 -0800 Cleans up cxxrandom.cpp DFHack contributions specifies: -spaces instead of tabs, so tabs were converted. -C++ headers before dfhack stuff, so it was done *Also added author name, creation date, and last updated date. Changes to be committed: modified: plugins/cxxrandom.cpp commit 498ebe4b8fdccc01ac1f169269f3093c830a8a10 Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Tue Dec 19 22:51:58 2017 -0800 Updates cxxrandom, fixes instance leak deleted header moved definition to cpp file #lethosor fixed singleton instance, no longer a pointer commented out dfhack commands, now only init/shutdown and exported lua functions modified: cxxrandom.cpp deleted: cxxrandom.h commit 821044bef2a0201d0d74192e445c7b29766b42a1 Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Sun Dec 17 04:01:11 2017 -0800 Fixes RollIndex and Renames RollNormal Renamed the Normal Distribution RNG function to fit the standard. Now named RollNormal(m,s) Fixed some wonky white space in the lua macro export block. Fixed a stupid mistake with the RollIndex output. (it was outputting 0's) Updated usage details. Changes to be committed: modified: plugins/cxxrandom.cpp commit 1536f43d137b6bc55d55759b43bdccf6ff429b33 Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Fri Dec 15 08:50:08 2017 -0800 Fixes/Improves cxxrandom Modified return types Corrected index distribution code commit 8629c7e1509522cb0cc4b649914b90d033cb4763 Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Thu Dec 14 19:02:29 2017 -0800 Implements SimpleNumDistribution Exported additional functions to lua. Functions allow the generation of random 0-N index values. Generation promises all unique values [0,N] will be returned once each when generation is run N times. On branch cxxrandom Changes to be committed: modified: plugins/cxxrandom.cpp modified: plugins/cxxrandom.h commit f035f3d20415790542cf83e5e696261661d911f3 Author: Josh Cooper <cooper.s.josh@gmail.com> Date: Wed Dec 13 23:55:39 2017 -0800 Implements cxxrandom cxxrandom was implemented using a singleton. This singleton provides an interface for generating uniform numbers, or numbers in a normal distribution, and also booleans(given the probability for the true outcome) The singleton interface is wrapped in functions which are exposed for lua usage. Integrated into plugins/CMakeLists.txt On branch dev Changes to be committed: modified: CMakeLists.txt new file: cxxrandom.cpp new file: cxxrandom.h new file: lua/cxxrandom.lua
2017-12-22 23:41:45 -07:00
DFHACK_PLUGIN(cxxrandom cxxrandom.cpp LINK_LIBRARIES lua)
2012-02-21 10:19:17 -07:00
DFHACK_PLUGIN(deramp deramp.cpp)
DFHACK_PLUGIN(dig dig.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(digFlood digFlood.cpp)
add_subdirectory(diggingInvaders)
DFHACK_PLUGIN(dwarfvet dwarfvet.cpp)
2015-07-29 12:47:55 -06:00
DFHACK_PLUGIN(dwarfmonitor dwarfmonitor.cpp LINK_LIBRARIES lua)
2017-09-01 06:13:34 -06:00
add_subdirectory(embark-assistant)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(embark-tools embark-tools.cpp)
DFHACK_PLUGIN(eventful eventful.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(fastdwarf fastdwarf.cpp)
2012-02-21 10:19:17 -07:00
DFHACK_PLUGIN(filltraffic filltraffic.cpp)
2015-02-08 15:22:19 -07:00
DFHACK_PLUGIN(fix-armory fix-armory.cpp)
DFHACK_PLUGIN(fix-unit-occupancy fix-unit-occupancy.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(fixveins fixveins.cpp)
DFHACK_PLUGIN(flows flows.cpp)
2012-02-21 10:19:17 -07:00
DFHACK_PLUGIN(follow follow.cpp)
DFHACK_PLUGIN(forceequip forceequip.cpp)
DFHACK_PLUGIN(fortplan fortplan.cpp LINK_LIBRARIES buildingplan-lib)
2017-02-05 21:42:20 -07:00
DFHACK_PLUGIN(generated-creature-renamer generated-creature-renamer.cpp)
DFHACK_PLUGIN(getplants getplants.cpp)
2014-06-01 21:48:34 -06:00
DFHACK_PLUGIN(hotkeys hotkeys.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(infiniteSky infiniteSky.cpp)
DFHACK_PLUGIN(isoworldremote isoworldremote.cpp PROTOBUFS isoworldremote)
DFHACK_PLUGIN(jobutils jobutils.cpp)
2017-07-28 01:43:32 -06:00
add_subdirectory(labormanager)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(lair lair.cpp)
DFHACK_PLUGIN(liquids liquids.cpp Brushes.h LINK_LIBRARIES lua)
2015-08-15 06:12:13 -06:00
DFHACK_PLUGIN(luasocket luasocket.cpp LINK_LIBRARIES clsocket lua dfhack-tinythread)
DFHACK_PLUGIN(manipulator manipulator.cpp)
DFHACK_PLUGIN(misery misery.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(mode mode.cpp)
DFHACK_PLUGIN(mousequery mousequery.cpp)
DFHACK_PLUGIN(orders orders.cpp LINK_LIBRARIES jsoncpp_lib_static)
2017-07-05 21:54:55 -06:00
DFHACK_PLUGIN(pathable pathable.cpp LINK_LIBRARIES lua)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(petcapRemover petcapRemover.cpp)
DFHACK_PLUGIN(plants plants.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(probe probe.cpp)
DFHACK_PLUGIN(prospector prospector.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(power-meter power-meter.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(regrass regrass.cpp)
add_subdirectory(remotefortressreader)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename)
2014-11-07 14:43:50 -07:00
add_subdirectory(rendermax)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(resume resume.cpp)
DFHACK_PLUGIN(reveal reveal.cpp)
DFHACK_PLUGIN(search search.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(seedwatch seedwatch.cpp)
DFHACK_PLUGIN(showmood showmood.cpp)
DFHACK_PLUGIN(siege-engine siege-engine.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(sort sort.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(steam-engine steam-engine.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(stockflow stockflow.cpp LINK_LIBRARIES lua)
add_subdirectory(stockpiles)
2013-04-05 22:40:07 -06:00
DFHACK_PLUGIN(stocks stocks.cpp)
DFHACK_PLUGIN(strangemood strangemood.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(tiletypes tiletypes.cpp Brushes.h)
2016-08-09 18:09:50 -06:00
DFHACK_PLUGIN(title-folder title-folder.cpp)
DFHACK_PLUGIN(title-version title-version.cpp)
DFHACK_PLUGIN(trackstop trackstop.cpp)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(tubefill tubefill.cpp)
add_subdirectory(tweak)
2014-06-30 00:51:23 -06:00
DFHACK_PLUGIN(workflow workflow.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(workNow workNow.cpp)
DFHACK_PLUGIN(zone zone.cpp LINK_LIBRARIES lua)
2014-03-04 10:00:12 -07:00
endif()
2012-02-21 10:19:17 -07:00
2011-10-06 19:53:58 -06:00
# this is the skeleton plugin. If you want to make your own, make a copy and then change it
OPTION(BUILD_SKELETON "Build the skeleton plugin." OFF)
if(BUILD_SKELETON)
add_subdirectory(skeleton)
endif()
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.custom.txt")
FILE(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.custom.txt" "# You can add custom plugins here to avoid touching plugins/CMakeLists.txt,
# This can be useful if you've made modifications to that file and try to
# switch between branches that have also made modifications to it.
")
endif()
INCLUDE(CMakeLists.custom.txt)