Extracted CBot tools

dev
Tomasz Kapuściński 2023-08-22 22:01:24 +02:00
parent 2b84da8a77
commit 510fe6804a
9 changed files with 36 additions and 27 deletions

View File

@ -38,7 +38,7 @@ class CBotDebug;
* \endcode
* the following structure is generated:
* \dot
* # Generated using the CBot_compile_graph tool
* # Generated using the CBot-CompileGraph tool
* # and slightly modified
* digraph {
* start [label=<START> shape=box3d color=cyan]

View File

@ -444,6 +444,10 @@ add_subdirectory(colobot-app)
add_subdirectory(po)
if(TOOLS)
add_subdirectory(tools)
endif()
if(DESKTOP)
add_subdirectory(desktop)
endif()

View File

@ -5,6 +5,3 @@ set(CMAKE_CXX_FLAGS_DEBUG ${COLOBOT_CXX_FLAGS_DEBUG})
# Unit tests
add_subdirectory(unit)
# CBot tests
add_subdirectory(cbot)

View File

@ -1,21 +0,0 @@
add_executable(CBot_console console.cpp)
target_link_directories(CBot_console PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(CBot_console PRIVATE
CBot
Colobot-Base # Needed for error strings (TODO: why are they on Colobot side? :/)
)
add_executable(CBot_compile_graph compile_graph.cpp)
target_link_directories(CBot_compile_graph PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(CBot_compile_graph CBot)
if(COLOBOT_LINT_BUILD)
add_fake_header_sources("test/cbot" CBot_console)
add_fake_header_sources("test/cbot" CBot_compile_graph)
endif()

2
tools/CMakeLists.txt Normal file
View File

@ -0,0 +1,2 @@
add_subdirectory(cbot-console)
add_subdirectory(cbot-graph)

View File

@ -0,0 +1,13 @@
add_executable(CBot-Console
src/console.cpp
)
target_link_directories(CBot-Console PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(CBot-Console PRIVATE
CBot
Colobot-Base # Needed for error strings (TODO: why are they on Colobot side? :/)
)

View File

@ -0,0 +1,14 @@
add_executable(CBot-CompileGraph
src/compile_graph.cpp
)
target_link_directories(CBot-CompileGraph PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(CBot-CompileGraph PRIVATE CBot)
if(COLOBOT_LINT_BUILD)
add_fake_header_sources("test/cbot" CBot-CompileGraph)
endif()

View File

@ -29,13 +29,13 @@
*
* To generate the graph, pass the output to GraphViz:
* \code{.sh}
* ./CBot_compile_graph < input_file.txt | dot -Tx11
* ./CBot-CompileGraph < input_file.txt | dot -Tx11
* \endcode
*
* or for output to file:
*
* \code{.sh}
* ./CBot_compile_graph < input_file.txt | dot -Tpng -o output.png
* ./CBot-CompileGraph < input_file.txt | dot -Tpng -o output.png
* \endcode
*/