Skip to content

Commit

Permalink
Generate .zip/.tar.gz release with CPack
Browse files Browse the repository at this point in the history
  • Loading branch information
balintkissdev committed Mar 17, 2021
1 parent 405ad3f commit 21c8b99
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,18 @@ add_custom_command(
"${PROJECT_SOURCE_DIR}/resources"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/resources"
)

set(CPACK_PACKAGE_NAME "Raycaster")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})

install(TARGETS ${PROJECT_NAME} RUNTIME CONFIGURATIONS Release DESTINATION ".")
install(FILES "${PROJECT_SOURCE_DIR}/README.md" DESTINATION ".")
install(DIRECTORY "${PROJECT_SOURCE_DIR}/resources/" DESTINATION "resources")
if(WIN32)
set(CPACK_GENERATOR ZIP)
else()
set(CPACK_GENERATOR TGZ)
endif()
include(CPack)
26 changes: 13 additions & 13 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
target_sources(${PROJECT_NAME}
PRIVATE
src/Camera.cpp
src/Camera.h
src/Game.cpp
src/Game.h
src/IRenderer.h
src/Main.cpp
src/MathLib.h
src/RayCaster.cpp
src/RayCaster.h
src/SDLRenderer.cpp
src/SDLRenderer.h
src/Texture.h
src/WallTypes.h
Camera.cpp
Camera.h
Game.cpp
Game.h
IRenderer.h
Main.cpp
MathLib.h
RayCaster.cpp
RayCaster.h
SDLRenderer.cpp
SDLRenderer.h
Texture.h
WallTypes.h
)

0 comments on commit 21c8b99

Please sign in to comment.