Skip to content

Commit 5a1b455

Browse files
committed
Added missing drawings main.
1 parent ffd5ff0 commit 5a1b455

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ bin
66
*.save-failed
77
__history/
88
*.cbp
9-
main.hpp
10-
main.cpp
119
*.png
1210
.vscode
1311
build

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ if(INT_TREE_DRAW_EXAMPLES)
1414
endif()
1515
if (INT_TREE_ENABLE_TESTS)
1616
add_subdirectory(tests)
17-
endif()
17+
endif()
18+

drawings/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,13 @@ add_executable(interval-tree-drawings "main.cpp")
44

55
target_link_libraries(interval-tree-drawings PRIVATE interval-tree cairo cairo-wrap)
66

7-
set_target_properties(interval-tree-drawings PROPERTIES OUTPUT_NAME "make_drawings")
7+
set_target_properties(interval-tree-drawings PROPERTIES OUTPUT_NAME "make_drawings")
8+
9+
# If msys2, copy dynamic libraries to executable directory, visual studio does this automatically.
10+
# And there is no need on linux.
11+
if (DEFINED ENV{MSYSTEM})
12+
add_custom_command(TARGET interval-tree-drawings POST_BUILD
13+
COMMAND bash -c "ldd $<TARGET_FILE:interval-tree-drawings>" | "grep" "clang" | awk "NF == 4 { system(\"${CMAKE_COMMAND} -E copy \" \$3 \" $<TARGET_FILE_DIR:interval-tree-drawings>\") }"
14+
VERBATIM
15+
)
16+
endif()

drawings/main.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "example_drawings.hpp"
2+
3+
#if __cplusplus >= 201703L
4+
# include <filesystem>
5+
#endif
6+
7+
int main()
8+
{
9+
#if __cplusplus >= 201703L
10+
if (!std::filesystem::exists("drawings"))
11+
std::filesystem::create_directory("drawings");
12+
#endif
13+
14+
drawAll();
15+
}

0 commit comments

Comments
 (0)