Skip to content

Commit 997e8e6

Browse files
committed
cmake packaging
1 parent 13b7933 commit 997e8e6

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

CMakeLists.txt

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
cmake_minimum_required (VERSION 3.8)
1+
cmake_minimum_required (VERSION 3.10)
22

33
set(CMAKE_C_STANDARD 17)
44
set(CMAKE_C_STANDARD_REQUIRED True)
55

6-
project("vkEngine" LANGUAGES C)
6+
project("vkEngine" LANGUAGES C VERSION 0.0.5)
77

88
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
99
include("fetchDeps")
@@ -95,3 +95,29 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
9595
endif()
9696

9797
buildShaders()
98+
99+
install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION .)
100+
101+
install(DIRECTORY assets/ DESTINATION assets)
102+
install(DIRECTORY pipelines/ DESTINATION pipelines FILES_MATCHING PATTERN "*.pipeline")
103+
install(FILES config.ini README.md LICENSE DESTINATION .)
104+
105+
include(InstallRequiredSystemLibraries)
106+
107+
set(CPACK_PACKAGE_NAME "vkEngine")
108+
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
109+
set(CPACK_PACKAGE_CONTACT "nitrogl@gmail.com")
110+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vkEngine - Not a demo, demo.")
111+
set(CPACK_PACKAGE_VENDOR "NitroGL")
112+
113+
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
114+
set(CPACK_GENERATOR "ZIP")
115+
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
116+
set(CPACK_GENERATOR "TGZ")
117+
elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
118+
message("???")
119+
endif()
120+
121+
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}")
122+
123+
include(CPack)

cmake/buildWindows.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function("buildWindows")
22
set(PA_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
3-
add_subdirectory(deps/portaudio)
3+
add_subdirectory(deps/portaudio EXCLUDE_FROM_ALL)
44

55
add_definitions(-DWIN32 -D_CRT_SECURE_NO_WARNINGS -D_CONSOLE)
66
list(APPEND PROJECT_SOURCES audio/backend/portaudio.c system/win32/win32.c)

cmake/fetchDeps.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ function(fetchDeps)
77
find_program(GLSLC NAMES glslc HINTS Vulkan::glslc)
88

99
message(STATUS "${PROJECT_NAME}: Fetching OpenXR...")
10-
add_subdirectory(deps/OpenXR-SDK)
10+
add_subdirectory(deps/OpenXR-SDK EXCLUDE_FROM_ALL)
1111

1212
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
1313
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
1414

1515
message(STATUS "${PROJECT_NAME}: Fetching OGG...")
16-
add_subdirectory(deps/ogg)
16+
add_subdirectory(deps/ogg EXCLUDE_FROM_ALL)
1717

1818
message(STATUS "${PROJECT_NAME}: Fetching Vorbis...")
19-
add_subdirectory(deps/vorbis)
19+
add_subdirectory(deps/vorbis EXCLUDE_FROM_ALL)
2020
endFunction()

system/linux/linux_wayland.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ static void handleShellSurfaceConfigure(void *data, struct xdg_surface *shellSur
8787

8888
static void handleToplevelConfigure(void *data, struct xdg_toplevel *toplevel, int32_t width, int32_t height, struct wl_array *states)
8989
{
90-
if(width!=0&&height!=0)
91-
{
92-
printf("%d %d", width, height);
93-
}
9490
}
9591

9692
static void handleToplevelClose(void *data, struct xdg_toplevel *toplevel)

0 commit comments

Comments
 (0)