Skip to content

Commit

Permalink
Merge pull request #84 from rozukke/add/example-build
Browse files Browse the repository at this point in the history
Automatically build examples
  • Loading branch information
rozukke authored Sep 9, 2024
2 parents 8a42341 + e454564 commit 329ef5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ install(TARGETS ${PROJECT_NAME}
PUBLIC_HEADER DESTINATION ${HEADER_INSTALL_DIR}
)

# Build examples
add_executable(pyramid example/pyramid.cpp)
target_link_libraries(pyramid ${PROJECT_NAME})
add_executable(hello_minecraft example/hello_minecraft.cpp)
target_link_libraries(hello_minecraft ${PROJECT_NAME})

# CPack setup
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "rozukke")
INCLUDE(CPack)
INCLUDE(CPack)
8 changes: 8 additions & 0 deletions example/hello_minecraft.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <mcpp/mcpp.h>

using namespace mcpp;

int main() {
MinecraftConnection mc;
mc.postToChat("Hello, Minecraft!");
}

0 comments on commit 329ef5b

Please sign in to comment.