Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
fa9684d0
Commit
fa9684d0
authored
Nov 09, 2015
by
Brenden Blanco
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #286 from troyengel/master
Fixes #285 - build process assumes git use
parents
83f29d84
576dc071
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
cmake/version.cmake
cmake/version.cmake
+11
-9
src/python/CMakeLists.txt
src/python/CMakeLists.txt
+6
-2
No files found.
cmake/version.cmake
View file @
fa9684d0
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
get_git_head_revision
(
GIT_REFSPEC GIT_SHA1
)
string
(
SUBSTRING
"
${
GIT_SHA1
}
"
0 8 GIT_SHA1_SHORT
)
git_describe
(
GIT_DESCRIPTION
)
git_describe
(
GIT_TAG_LAST
"--abbrev=0"
)
git_get_exact_tag
(
GIT_TAG_EXACT
)
if
(
NOT REVISION
)
get_git_head_revision
(
GIT_REFSPEC GIT_SHA1
)
string
(
SUBSTRING
"
${
GIT_SHA1
}
"
0 8 GIT_SHA1_SHORT
)
git_describe
(
GIT_DESCRIPTION
)
git_describe
(
GIT_TAG_LAST
"--abbrev=0"
)
git_get_exact_tag
(
GIT_TAG_EXACT
)
string
(
SUBSTRING
"
${
GIT_TAG_LAST
}
-
${
GIT_SHA1_SHORT
}
"
1 -1 REVISION
)
if
(
GIT_TAG_EXACT
)
string
(
SUBSTRING
"
${
GIT_TAG_EXACT
}
"
1 -1 REVISION
)
...
...
@@ -15,11 +15,13 @@ if(NOT REVISION)
set
(
GIT_TAG_EXACT
""
)
endif
()
message
(
STATUS
"Git HEAD is
${
GIT_SHA1
}
"
)
# rpm/deb packaging uses this, only works on whole tag numbers
if
(
NOT REVISION_LAST
)
string
(
SUBSTRING
"
${
GIT_TAG_LAST
}
"
1 -1 REVISION_LAST
)
endif
()
else
()
set
(
REVISION_LAST
"
${
REVISION
}
"
)
endif
()
# strip leading 'v', and make unique for the tag
message
(
STATUS
"Revision is
${
REVISION
}
"
)
# rpm/deb packaging uses this, only works on whole tag numbers
if
(
NOT REVISION_LAST
)
string
(
SUBSTRING
"
${
GIT_TAG_LAST
}
"
1 -1 REVISION_LAST
)
endif
()
src/python/CMakeLists.txt
View file @
fa9684d0
...
...
@@ -7,11 +7,15 @@ endmacro()
symlink_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/bcc
${
CMAKE_CURRENT_BINARY_DIR
}
/bcc
)
if
(
NOT PYTHON_CMD
)
set
(
PYTHON_CMD
"python"
)
endif
()
set
(
PIP_INSTALLABLE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dist/bcc-
${
REVISION
}
.tar.gz"
)
configure_file
(
setup.py.in
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py @ONLY
)
# build the pip installable
add_custom_command
(
OUTPUT
${
PIP_INSTALLABLE
}
COMMAND
python
setup.py sdist
COMMAND
${
PYTHON_CMD
}
setup.py sdist
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/bcc/__init__.py
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py
)
...
...
@@ -20,6 +24,6 @@ add_custom_target(bcc_py ALL DEPENDS ${PIP_INSTALLABLE})
if
(
EXISTS
"/etc/debian_version"
)
set
(
PYTHON_FLAGS
"
${
PYTHON_FLAGS
}
--install-layout deb"
)
endif
()
install
(
CODE
"execute_process(COMMAND
python
setup.py install -f
${
PYTHON_FLAGS
}
install
(
CODE
"execute_process(COMMAND
${
PYTHON_CMD
}
setup.py install -f
${
PYTHON_FLAGS
}
--prefix=
${
CMAKE_INSTALL_PREFIX
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)"
COMPONENT python
)
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