Skip to content

Commit 134b3e9

Browse files
bikz05gineshidalgo99
authored andcommitted
CMake support added (#234)
1 parent a2c15f4 commit 134b3e9

40 files changed

+1335
-3
lines changed

.github/generate_gh_pages.sh

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/bin/sh
2+
################################################################################
3+
# Title : generate_gh_pages.sh
4+
# Date created : 2016/02/22
5+
# Notes :
6+
__AUTHOR__="openpose"
7+
# Preconditions:
8+
# - Packages doxygen doxygen-doc doxygen-latex doxygen-gui graphviz
9+
# must be installed.
10+
# - Doxygen configuration file must have the destination directory empty and
11+
# source code directory with a $(TRAVIS_BUILD_DIR) prefix.
12+
# - An gh-pages branch should already exist. See below for mor info on hoe to
13+
# create a gh-pages branch.
14+
#
15+
# Required global variables:
16+
# - TRAVIS_BUILD_NUMBER : The number of the current build.
17+
# - TRAVIS_COMMIT : The commit that the current build is testing.
18+
# - DOXYFILE : The Doxygen configuration file.
19+
# - GH_REPO_NAME : The name of the repository.
20+
# - GH_REPO_REF : The GitHub reference to the repository.
21+
# - GH_REPO_TOKEN : Secure token to the github repository.
22+
#
23+
# For information on how to encrypt variables for Travis CI please go to
24+
# https://docs.travis-ci.com/user/environment-variables/#Encrypted-Variables
25+
# or https://gist.github.com/vidavidorra/7ed6166a46c537d3cbd2
26+
# For information on how to create a clean gh-pages branch from the master
27+
# branch, please go to https://gist.github.com/vidavidorra/846a2fc7dd51f4fe56a0
28+
#
29+
# This script will generate Doxygen documentation and push the documentation to
30+
# the gh-pages branch of a repository specified by GH_REPO_REF.
31+
# Before this script is used there should already be a gh-pages branch in the
32+
# repository.
33+
#
34+
################################################################################
35+
36+
################################################################################
37+
##### Setup this script and get the current gh-pages branch. #####
38+
echo 'Setting up the script...'
39+
# Exit with nonzero exit code if anything fails
40+
set -e
41+
42+
# Create a clean working directory for this script.
43+
mkdir code_docs
44+
cd code_docs
45+
46+
# Get the current gh-pages branch
47+
git clone -b gh-pages https://git@$GH_REPO_REF
48+
cd $GH_REPO_NAME
49+
50+
##### Configure git.
51+
# Set the push default to simple i.e. push only the current branch.
52+
git config --global push.default simple
53+
# Pretend to be an user called Travis CI.
54+
git config user.name "Travis CI"
55+
git config user.email "[email protected]"
56+
57+
# Remove everything currently in the gh-pages branch.
58+
# GitHub is smart enough to know which files have changed and which files have
59+
# stayed the same and will only update the changed files. So the gh-pages branch
60+
# can be safely cleaned, and it is sure that everything pushed later is the new
61+
# documentation.
62+
rm -rf *
63+
64+
# Need to create a .nojekyll file to allow filenames starting with an underscore
65+
# to be seen on the gh-pages site. Therefore creating an empty .nojekyll file.
66+
# Presumably this is only needed when the SHORT_NAMES option in Doxygen is set
67+
# to NO, which it is by default. So creating the file just in case.
68+
echo "" > .nojekyll
69+
70+
################################################################################
71+
##### Generate the Doxygen code documentation and log the output. #####
72+
echo 'Generating Doxygen code documentation...'
73+
# Redirect both stderr and stdout to the log file AND the console.
74+
echo "INPUT = ${TRAVIS_BUILD_DIR}/README.md ${TRAVIS_BUILD_DIR}/include/openpose/" >> $DOXYFILE
75+
echo "USE_MDFILE_AS_MAINPAGE = ${TRAVIS_BUILD_DIR}/README.md" >> $DOXYFILE
76+
echo "OUTPUT_DIRECTORY = " >> $DOXYFILE
77+
doxygen $DOXYFILE 2>&1 | tee doxygen.log
78+
79+
################################################################################
80+
##### Upload the documentation to the gh-pages branch of the repository. #####
81+
# Only upload if Doxygen successfully created the documentation.
82+
# Check this by verifying that the html directory and the file html/index.html
83+
# both exist. This is a good indication that Doxygen did it's work.
84+
if [ -d "html" ] && [ -f "html/index.html" ]; then
85+
86+
echo 'Uploading documentation to the gh-pages branch...'
87+
# Add everything in this directory (the Doxygen code documentation) to the
88+
# gh-pages branch.
89+
# GitHub is smart enough to know which files have changed and which files have
90+
# stayed the same and will only update the changed files.
91+
git add --all
92+
93+
# Commit the added files with a title and description containing the Travis CI
94+
# build number and the GitHub commit reference that issued this build.
95+
git commit -m "Deploy code docs to GitHub Pages Travis build: ${TRAVIS_BUILD_NUMBER}" -m "Commit: ${TRAVIS_COMMIT}"
96+
97+
# Force push to the remote gh-pages branch.
98+
# The ouput is redirected to /dev/null to hide any sensitive credential data
99+
# that might otherwise be exposed.
100+
git push --force "https://${GH_REPO_TOKEN}@${GH_REPO_REF}" > /dev/null 2>&1
101+
else
102+
echo '' >&2
103+
echo 'Warning: No documentation (html) files have been found!' >&2
104+
echo 'Warning: Not going to push the documentation to GitHub!' >&2
105+
exit 1
106+
fi

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ MANIFEST-*
5858
# OSX dir files
5959
.DS_Store
6060

61+
# Vim files
62+
cscope.*
63+
tags
64+
.clang_complete
65+
.vim
66+
6167
######################### Windows (Visual Studio) Files #########################
6268
*.db
6369
*.deps

.travis.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This will run on Travis' 'new' container-based infrastructure
2+
3+
# Blacklist
4+
branches:
5+
only:
6+
- master
7+
8+
# OS
9+
dist: trusty
10+
sudo: required
11+
12+
# Environment variables
13+
env:
14+
global:
15+
- GH_REPO_NAME: openpose
16+
- DOXYFILE: $TRAVIS_BUILD_DIR/doc/doc_autogeneration.doxygen
17+
# Set this in Environment Variables on travis-ci.org
18+
# - GH_REPO_REF: github.com/<user_name>/openpose.git
19+
20+
# Install dependencies
21+
addons:
22+
apt:
23+
packages:
24+
- doxygen
25+
- doxygen-doc
26+
- doxygen-latex
27+
- doxygen-gui
28+
- graphviz
29+
30+
# Build your code e.g. by calling make
31+
script:
32+
- ./ubuntu/install_cmake.sh
33+
- sudo apt-get -y install libatlas-base-dev
34+
- sudo apt-get -y install libopencv-dev
35+
- pip install --upgrade numpy
36+
- mkdir build
37+
- cd build
38+
- cmake -DBUILD_CAFFE=ON ..
39+
- no_cores=`cat /proc/cpuinfo | grep processor | wc -l`
40+
- make -j${no_cores}
41+
42+
# Generate and deploy documentation
43+
after_success:
44+
- cd $TRAVIS_BUILD_DIR
45+
- chmod +x .github/generate_gh_pages.sh
46+
- ./.github/generate_gh_pages.sh

3rdparty/caffe/cmake/Dependencies.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(Caffe_DEFINITIONS "")
55
set(Caffe_COMPILE_OPTIONS "")
66

77
# ---[ Boost
8-
find_package(Boost 1.55 REQUIRED COMPONENTS system thread filesystem)
8+
find_package(Boost 1.54 REQUIRED COMPONENTS system thread filesystem)
99
list(APPEND Caffe_INCLUDE_DIRS PUBLIC ${Boost_INCLUDE_DIRS})
1010
list(APPEND Caffe_LINKER_LIBS PUBLIC ${Boost_LIBRARIES})
1111

0 commit comments

Comments
 (0)