Skip to content

Commit 7dce612

Browse files
committed
Add release target
1 parent d7c0044 commit 7dce612

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ add_custom_command(
5252
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
5353
add_custom_target(package DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}")
5454

55+
# create a release (by pushing a tag to the repository)
56+
57+
find_program(GIT git REQUIRED)
58+
59+
add_custom_target(
60+
release
61+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
62+
COMMAND "${GIT}" tag "v${CMAKE_PROJECT_VERSION}"
63+
COMMAND "${GIT}" push "v${CMAKE_PROJECT_VERSION}")
64+
5565
# optional examples
5666

5767
if(TRAITS_BUILD_EXAMPLES)

0 commit comments

Comments
 (0)