Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
90
Issues
90
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louiz’
biboumi
Commits
2cf64e10
Commit
2cf64e10
authored
Jun 24, 2014
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a make dist target
parent
39175e1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
CMakeLists.txt
CMakeLists.txt
+18
-3
No files found.
CMakeLists.txt
View file @
2cf64e10
...
...
@@ -27,16 +27,22 @@ find_package(Botan)
#
## Get the software version
#
if
(
${
PROJECT_NAME
}
_VERSION_SUFFIX MATCHES
"~dev"
)
set
(
ARCHIVE_NAME
${
CMAKE_PROJECT_NAME
}
-
${${
PROJECT_NAME
}
_VERSION_MAJOR
}
.
${${
PROJECT_NAME
}
_VERSION_MINOR
}
)
if
(
${
PROJECT_NAME
}
_VERSION_SUFFIX MATCHES
".+"
)
set
(
ARCHIVE_NAME
${
ARCHIVE_NAME
}
-
${${
PROJECT_NAME
}
_VERSION_SUFFIX
}
)
endif
()
if
(
${
PROJECT_NAME
}
_VERSION_SUFFIX MATCHES
"^~dev$"
)
# If we are on a dev version, append the hash of the current git HEAD to
# the version
include
(
FindGit
)
if
(
GIT_FOUND
)
if
(
GIT_FOUND
AND EXISTS
"
${
CMAKE_SOURCE_DIR
}
/.git"
)
execute_process
(
COMMAND git --git-dir=
${
CMAKE_SOURCE_DIR
}
/.git rev-parse --short HEAD
OUTPUT_VARIABLE GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
GIT_REVISION
)
set
(
${
PROJECT_NAME
}
_VERSION_SUFFIX
"
${${
PROJECT_NAME
}
_VERSION_SUFFIX
}
(
${
GIT_REVISION
}
)"
)
set
(
ARCHIVE_NAME
${
ARCHIVE_NAME
}
-
${
GIT_REVISION
}
)
endif
()
endif
()
endif
()
...
...
@@ -193,4 +199,13 @@ install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
)
if
(
WITH_DOC
)
install
(
FILES
${
MAN_PAGE
}
DESTINATION man/man1
)
endif
()
\ No newline at end of file
endif
()
#
## Dist target
## Generate a release tarball from the git sources
#
add_custom_target
(
dist
COMMAND git archive --prefix=
${
ARCHIVE_NAME
}
/ --format=tar HEAD
| xz >
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
ARCHIVE_NAME
}
.tar.xz
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment