2011-09-01 17:25:01 -06:00
|
|
|
INCLUDE(Plugins.cmake)
|
2011-07-25 03:09:29 -06:00
|
|
|
|
2012-07-08 17:05:40 -06:00
|
|
|
OPTION(BUILD_STONESENSE "Build stonesense (needs a checkout first)." OFF)
|
2011-07-21 03:29:26 -06:00
|
|
|
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)
|
2014-07-21 12:18:29 -06:00
|
|
|
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)
|
2011-07-14 00:52:06 -06:00
|
|
|
endif()
|
2011-07-16 10:10:08 -06:00
|
|
|
|
2012-07-05 09:39:27 -06:00
|
|
|
OPTION(BUILD_RUBY "Build ruby binding." ON)
|
2012-03-21 11:49:50 -06:00
|
|
|
if (BUILD_RUBY)
|
|
|
|
add_subdirectory (ruby)
|
|
|
|
endif()
|
|
|
|
|
Allow plugins to export functions to lua with safe reload support.
- To ensure reload safety functions have to be wrapped. Every call
checks the loaded state and locks a mutex in Plugin. If the plugin
is unloaded, calling its functions throws a lua error. Therefore,
plugins may not create closures or export yieldable functions.
- The set of function argument and return types supported by
LuaWrapper is severely limited when compared to being compiled
inside the main library.
Currently supported types: numbers, bool, std::string, df::foo,
df::foo*, std::vector<bool>, std::vector<df::foo*>.
- To facilitate postponing initialization until after all plugins
have been loaded, the core sends a SC_CORE_INITIALIZED event.
- As an example, the burrows plugin now exports its functions.
2012-04-14 09:44:07 -06:00
|
|
|
install(DIRECTORY lua/
|
|
|
|
DESTINATION ${DFHACK_LUA_DESTINATION}/plugins
|
|
|
|
FILES_MATCHING PATTERN "*.lua")
|
2012-09-06 07:10:58 -06:00
|
|
|
install(DIRECTORY raw/
|
|
|
|
DESTINATION ${DFHACK_DATA_DESTINATION}/raw
|
|
|
|
FILES_MATCHING PATTERN "*.txt")
|
2012-09-17 11:15:51 -06:00
|
|
|
install(DIRECTORY raw/
|
|
|
|
DESTINATION ${DFHACK_DATA_DESTINATION}/raw
|
|
|
|
FILES_MATCHING PATTERN "*.diff")
|
Allow plugins to export functions to lua with safe reload support.
- To ensure reload safety functions have to be wrapped. Every call
checks the loaded state and locks a mutex in Plugin. If the plugin
is unloaded, calling its functions throws a lua error. Therefore,
plugins may not create closures or export yieldable functions.
- The set of function argument and return types supported by
LuaWrapper is severely limited when compared to being compiled
inside the main library.
Currently supported types: numbers, bool, std::string, df::foo,
df::foo*, std::vector<bool>, std::vector<df::foo*>.
- To facilitate postponing initialization until after all plugins
have been loaded, the core sends a SC_CORE_INITIALIZED event.
- As an example, the burrows plugin now exports its functions.
2012-04-14 09:44:07 -06:00
|
|
|
|
2012-03-15 03:01:23 -06:00
|
|
|
# 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}")
|
2016-10-24 20:28:51 -06:00
|
|
|
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
|
2016-10-24 20:51:27 -06:00
|
|
|
# (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()
|
2012-03-15 03:01:23 -06:00
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(
|
2016-10-24 20:51:27 -06:00
|
|
|
OUTPUT ${PROJECT_PROTO_TMP_FILES}
|
2012-03-15 04:06:50 -06:00
|
|
|
COMMAND protoc-bin -I=${dfhack_SOURCE_DIR}/library/proto/
|
|
|
|
-I=${CMAKE_CURRENT_SOURCE_DIR}/proto/
|
2016-10-24 20:28:51 -06:00
|
|
|
--cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/proto/tmp/
|
2012-03-15 03:01:23 -06:00
|
|
|
${PROJECT_PROTOS}
|
2016-11-02 14:23:32 -06:00
|
|
|
COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/depends/copy-if-different.pl
|
2016-10-24 20:28:51 -06:00
|
|
|
${PROJECT_PROTO_TMP_FILES}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/proto/
|
|
|
|
COMMENT "Generating plugin protobufs"
|
2012-03-15 03:01:23 -06:00
|
|
|
DEPENDS protoc-bin ${PROJECT_PROTOS}
|
|
|
|
)
|
2016-10-24 20:51:27 -06:00
|
|
|
ADD_CUSTOM_TARGET(generate_proto DEPENDS ${PROJECT_PROTO_TMP_FILES})
|
2012-03-15 03:01:23 -06:00
|
|
|
|
2012-03-24 06:22:43 -06:00
|
|
|
SET_SOURCE_FILES_PROPERTIES( Brushes.h PROPERTIES HEADER_FILE_ONLY TRUE )
|
|
|
|
|
2015-10-18 11:08:48 -06:00
|
|
|
ADD_LIBRARY(buildingplan-lib STATIC buildingplan-lib.cpp)
|
2015-10-18 15:46:37 -06:00
|
|
|
TARGET_LINK_LIBRARIES(buildingplan-lib dfhack)
|
2015-10-18 11:08:48 -06:00
|
|
|
|
2012-03-15 03:01:23 -06:00
|
|
|
# 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)
|
2016-12-09 09:20:35 -07:00
|
|
|
#DFHACK_PLUGIN(advtools advtools.cpp)
|
2014-08-06 08:31:42 -06:00
|
|
|
DFHACK_PLUGIN(autochop autochop.cpp)
|
2014-06-30 00:51:23 -06:00
|
|
|
DFHACK_PLUGIN(autodump autodump.cpp)
|
2016-01-08 22:28:07 -07:00
|
|
|
DFHACK_PLUGIN(autogems autogems.cpp)
|
2015-02-27 21:18:26 -07:00
|
|
|
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)
|
2015-01-07 14:27:48 -07:00
|
|
|
DFHACK_PLUGIN(blueprint blueprint.cpp)
|
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)
|
2015-10-18 11:08:48 -06:00
|
|
|
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)
|
2015-11-21 16:59:30 -07:00
|
|
|
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)
|
2012-02-21 10:19:17 -07:00
|
|
|
DFHACK_PLUGIN(deramp deramp.cpp)
|
2014-07-25 19:49:46 -06:00
|
|
|
DFHACK_PLUGIN(dig dig.cpp)
|
2014-06-30 00:51:23 -06:00
|
|
|
DFHACK_PLUGIN(digFlood digFlood.cpp)
|
2017-08-06 19:01:36 -06:00
|
|
|
add_subdirectory(diggingInvaders)
|
2016-06-14 14:13:26 -06:00
|
|
|
DFHACK_PLUGIN(dwarfvet dwarfvet.cpp)
|
2015-07-29 12:47:55 -06:00
|
|
|
DFHACK_PLUGIN(dwarfmonitor dwarfmonitor.cpp LINK_LIBRARIES lua)
|
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)
|
2015-08-07 12:33:38 -06:00
|
|
|
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)
|
2012-05-15 04:03:29 -06:00
|
|
|
DFHACK_PLUGIN(forceequip forceequip.cpp)
|
2015-10-18 11:08:48 -06:00
|
|
|
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)
|
2014-08-06 08:31:42 -06:00
|
|
|
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)
|
2016-08-11 21:49:15 -06:00
|
|
|
DFHACK_PLUGIN(labormanager labormanager.cpp)
|
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)
|
2012-08-21 14:43:32 -06:00
|
|
|
DFHACK_PLUGIN(manipulator manipulator.cpp)
|
2016-12-10 16:22:28 -07:00
|
|
|
DFHACK_PLUGIN(misery misery.cpp)
|
2014-06-30 00:51:23 -06:00
|
|
|
DFHACK_PLUGIN(mode mode.cpp)
|
|
|
|
DFHACK_PLUGIN(mousequery mousequery.cpp)
|
2017-05-27 15:47:18 -06:00
|
|
|
DFHACK_PLUGIN(orders orders.cpp LINK_LIBRARIES jsoncpp)
|
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)
|
2014-08-06 08:31:42 -06:00
|
|
|
DFHACK_PLUGIN(plants plants.cpp)
|
2014-06-30 00:51:23 -06:00
|
|
|
DFHACK_PLUGIN(probe probe.cpp)
|
2014-08-06 08:31:42 -06:00
|
|
|
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)
|
2016-11-08 02:41:27 -07:00
|
|
|
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)
|
2012-10-19 06:38:28 -06:00
|
|
|
DFHACK_PLUGIN(search search.cpp)
|
2014-06-30 00:51:23 -06:00
|
|
|
DFHACK_PLUGIN(seedwatch seedwatch.cpp)
|
|
|
|
DFHACK_PLUGIN(showmood showmood.cpp)
|
2014-07-25 19:49:46 -06:00
|
|
|
DFHACK_PLUGIN(siege-engine siege-engine.cpp LINK_LIBRARIES lua)
|
2012-04-21 05:43:52 -06:00
|
|
|
DFHACK_PLUGIN(sort sort.cpp LINK_LIBRARIES lua)
|
2012-09-06 07:10:58 -06:00
|
|
|
DFHACK_PLUGIN(steam-engine steam-engine.cpp)
|
2014-06-30 00:51:23 -06:00
|
|
|
DFHACK_PLUGIN(stockflow stockflow.cpp LINK_LIBRARIES lua)
|
2014-12-02 04:06:01 -07:00
|
|
|
add_subdirectory(stockpiles)
|
2013-04-05 22:40:07 -06:00
|
|
|
DFHACK_PLUGIN(stocks stocks.cpp)
|
2014-01-18 21:45:42 -07:00
|
|
|
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)
|
2015-08-09 11:37:26 -06:00
|
|
|
DFHACK_PLUGIN(title-version title-version.cpp)
|
2014-09-28 18:24:07 -06:00
|
|
|
DFHACK_PLUGIN(trackstop trackstop.cpp)
|
2014-06-30 00:51:23 -06:00
|
|
|
DFHACK_PLUGIN(tubefill tubefill.cpp)
|
2014-09-26 16:40:19 -06:00
|
|
|
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()
|
2015-11-17 15:38:53 -07:00
|
|
|
|
|
|
|
INCLUDE(CMakeLists.custom.txt)
|