Skip to content

Commit ebaec3c

Browse files
committed
add release
1 parent cf3a1e6 commit ebaec3c

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

CMakeLists.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
cmake_minimum_required(VERSION 3.10)
2+
3+
set(BUILD_VERSION 1.0.0.0)
4+
25
project(slick_queue
3-
VERSION 0.1.0
6+
VERSION ${BUILD_VERSION}
47
DESCRIPTION "A C++ Lock-Free MPMC queue"
58
LANGUAGES CXX)
69

@@ -32,3 +35,23 @@ if(BUILD_SLICK_QUEUE_TESTS)
3235
endif()
3336
endif()
3437

38+
# Installation rules
39+
install(DIRECTORY include/ DESTINATION slick_queue/include)
40+
41+
message(STATUS "Build version: ${BUILD_VERSION}")
42+
43+
# Automatically run install after build in Release mode
44+
if(CMAKE_BUILD_TYPE STREQUAL "Release")
45+
add_custom_target(auto_install ALL
46+
COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --prefix ${CMAKE_BINARY_DIR}/dist
47+
COMMENT "Auto-installing after release build"
48+
VERBATIM
49+
)
50+
51+
add_custom_target(package ALL
52+
COMMAND ${CMAKE_COMMAND} -E tar "cfv" "${CMAKE_BINARY_DIR}/dist/slick_queue_${BUILD_VERSION}.zip" --format=zip "${CMAKE_CURRENT_SOURCE_DIR}/include"
53+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
54+
COMMENT "Creating zip archive"
55+
)
56+
endif()
57+

0 commit comments

Comments
 (0)