Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
André Pedro
CMake
Commits
bcfa890c
Commit
bcfa890c
authored
17 years ago
by
Bill Hoffman
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add package script for cmake project
parent
1904b3f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Templates/cygwin-package.sh.in
+101
-0
101 additions, 0 deletions
Templates/cygwin-package.sh.in
with
101 additions
and
0 deletions
Templates/cygwin-package.sh.in
0 → 100755
+
101
−
0
View file @
bcfa890c
# this is a sample shell script used for building a cmake
# based project for a cygwin setup package.
# get the current directory
TOP_DIR=`cd \`echo "$0" | sed -n '/\//{s/\/[^\/]*$//;p;}'\`;pwd`
# create build directory
mkdirs()
{
(
mkdir -p "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build"
)
}
# cd into
# untar source tree and apply patch
prep()
{
(
cd "$TOP_DIR" &&
tar xvfj @CPACK_PACKAGE_FILE_NAME@.tar.bz2
patch -p0 < "@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch" &&
mkdirs
)
}
# configure the build tree in .build directory
# of the source tree
conf()
{
(
cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
cmake ..
)
}
# build the package in the .build directory
build()
{
(
cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
make &&
make test
)
}
# clean the build tree
clean()
{
(
cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
make clean
)
}
# create the package
pkg()
{
(
cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
cpack &&
mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.tar.bz2 "$TOP_DIR"
)
}
# create the source package
spkg()
{
(
cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
cpack --config CPackSourceConfig.cmake &&
mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2 "$TOP_DIR"
)
}
# clean up
finish()
{
(
rm -rf "@CPACK_PACKAGE_FILE_NAME@"
)
}
case $1 in
prep) prep ; STATUS=$? ;;
mkdirs) mkdirs ; STATUS=$? ;;
conf) conf ; STATUS=$? ;;
build) build ; STATUS=$? ;;
clean) clean ; STATUS=$? ;;
package) pkg ; STATUS=$? ;;
pkg) pkg ; STATUS=$? ;;
src-package) spkg ; STATUS=$? ;;
spkg) spkg ; STATUS=$? ;;
finish) finish ; STATUS=$? ;;
all) (
prep && conf && build && pkg && spkg && finish ;
STATUS=$?
) ;;
*) echo "Error: bad argument (all or one of these: prep mkdirs conf build clean package pkg src-package spkg finish)" ; exit 1 ;;
esac
exit ${STATUS}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment