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
88
Issues
88
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
aaf71774
Commit
aaf71774
authored
Jun 17, 2014
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write the software version, including the git hash, in config.h using cmake
parent
2117838c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
CMakeLists.txt
CMakeLists.txt
+23
-2
src/config.h.cmake
src/config.h.cmake
+2
-1
No files found.
CMakeLists.txt
View file @
aaf71774
...
...
@@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 2.6)
project
(
biboumi
)
set
(
${
PROJECT_NAME
}
_VERSION_MAJOR 0
)
set
(
${
PROJECT_NAME
}
_VERSION_MINOR 1
)
set
(
${
PROJECT_NAME
}
_VERSION_MAJOR 1
)
set
(
${
PROJECT_NAME
}
_VERSION_MINOR 0
)
set
(
${
PROJECT_NAME
}
_VERSION_SUFFIX
"~dev"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++1y -pedantic -Wall -Wextra"
)
...
...
@@ -23,6 +24,26 @@ find_package(Libidn)
find_package
(
SystemdDaemon
)
find_package
(
Botan
)
#
## Get the software version
#
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
)
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
}
)"
)
endif
()
endif
()
endif
()
set
(
BIBOUMI_VERSION
${${
PROJECT_NAME
}
_VERSION_MAJOR
}
.
${${
PROJECT_NAME
}
_VERSION_MINOR
}${${
PROJECT_NAME
}
_VERSION_SUFFIX
}
)
# To be able to include the config.h file generated by cmake
include_directories
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/src/"
)
include_directories
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/"
)
...
...
src/config.h.cmake
View file @
aaf71774
...
...
@@ -2,4 +2,5 @@
#cmakedefine LIBIDN_FOUND
#cmakedefine SYSTEMDDAEMON_FOUND
#cmakedefine POLLER ${POLLER}
#cmakedefine BOTAN_FOUND
\ No newline at end of file
#cmakedefine BOTAN_FOUND
#cmakedefine BIBOUMI_VERSION "${BIBOUMI_VERSION}"
\ 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