Skip to content

Commit

Permalink
Rearrange cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
rozukke committed Oct 3, 2024
1 parent ae0ed4e commit df7898b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 114 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,13 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
# Start and join the Spigot Server
- name: Set up Minecraft testing environment
uses: nhatdongdang/[email protected]

# Checkout the mcpp repository for building and testing
- name: Checkout mcpp
uses: actions/checkout@v4

# Build files using CMake
# Build CMake cache
- name: Build file
run: cmake -Bbuild

# Run the test suite using ctest
- name: Run test suite
working-directory: ./build
run: make test_suite && ctest -R full -V
run: cmake --debug-output -B build

- name: Install library
working-directory: ./build
Expand All @@ -45,6 +36,15 @@ jobs:
working-directory: ./build
run: make examples

# Start and join the Spigot Server
- name: Set up Minecraft testing environment
uses: nhatdongdang/[email protected]

# Run the test suite using ctest
- name: Run test suite
working-directory: ./build
run: make test_suite && ctest -R full -V

- name: Run example
working-directory: ./build
run: ./hello_minecraft
92 changes: 0 additions & 92 deletions .github/workflows/package-release.yml

This file was deleted.

18 changes: 7 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,17 @@ install(TARGETS ${PROJECT_NAME}

# Build examples
add_executable(hello_minecraft EXCLUDE_FROM_ALL example/hello_minecraft.cpp)
target_link_libraries(hello_minecraft ${PROJECT_NAME})
add_executable(pyramid EXCLUDE_FROM_ALL example/pyramid.cpp)
target_link_libraries(pyramid ${PROJECT_NAME})
add_executable(game_of_life EXCLUDE_FROM_ALL example/game-of-life/game_of_life.cpp)
target_link_libraries(game_of_life ${PROJECT_NAME})
add_executable(minesweeper EXCLUDE_FROM_ALL example/minesweeper/minesweeper.cpp)
target_link_libraries(minesweeper ${PROJECT_NAME})
add_executable(video_mc EXCLUDE_FROM_ALL example/video-generation/video-mc.cpp)
target_link_libraries(video_mc ${PROJECT_NAME})
add_executable(obj_mc EXCLUDE_FROM_ALL example/model-generation/obj-mc.cpp)

target_link_libraries(hello_minecraft ${PROJECT_NAME})
target_link_libraries(pyramid ${PROJECT_NAME})
target_link_libraries(game_of_life ${PROJECT_NAME})
target_link_libraries(minesweeper ${PROJECT_NAME})
target_link_libraries(video_mc ${PROJECT_NAME})
target_link_libraries(obj_mc ${PROJECT_NAME})
add_custom_target(examples DEPENDS hello_minecraft pyramid game_of_life minesweeper video_mc obj_mc)

# CPack setup
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "rozukke")
INCLUDE(CPack)
add_custom_target(examples DEPENDS hello_minecraft pyramid game_of_life minesweeper video_mc obj_mc)

0 comments on commit df7898b

Please sign in to comment.