Skip to content

Commit

Permalink
Automatically build examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rozukke committed Sep 8, 2024
1 parent cfbf035 commit e454564
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 @@ -45,8 +45,14 @@ install(TARGETS ${PROJECT_NAME}
PUBLIC_HEADER DESTINATION include/${PROJECT_NAME}
)

# 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 e454564

Please sign in to comment.