xo-cmake: + subsystem-list + xo-build improvements
This commit is contained in:
parent
89ef68f5f2
commit
f510700b99
4 changed files with 99 additions and 46 deletions
|
|
@ -47,6 +47,13 @@ install(
|
||||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
"etc/xo/subsystem-list"
|
||||||
|
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/etc/xo
|
||||||
|
)
|
||||||
|
|
||||||
# The cmake template gen-ccov.in should be expanded in downstream project;
|
# The cmake template gen-ccov.in should be expanded in downstream project;
|
||||||
# to pickup downstream project's PROJECT_SOURCE_DIR / PROJECT_BINARY_DIR
|
# to pickup downstream project's PROJECT_SOURCE_DIR / PROJECT_BINARY_DIR
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "$0 [-u|--usage|-h|--help] [--xoname=NAME] [--repo]"
|
cat <<EOF
|
||||||
|
$0 [-u|--usage|-h|--help]
|
||||||
|
[--list] [-n] [--xoname=NAME]
|
||||||
|
[--repo|--clone|--configure|--build|--install]
|
||||||
|
[-S=SOURCEDIR] [-B=BUILDDIR]
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
|
|
@ -14,7 +19,7 @@ fetch and/or build xo component libraries
|
||||||
Options:
|
Options:
|
||||||
-u | --usage brief help message
|
-u | --usage brief help message
|
||||||
-h | --help this help message
|
-h | --help this help message
|
||||||
--list list known xo library
|
--list list known xo libraries
|
||||||
-n dry-run: don't actually invoke state-changing commands
|
-n dry-run: don't actually invoke state-changing commands
|
||||||
--xoname=NAME operate on xo subsystem NAME
|
--xoname=NAME operate on xo subsystem NAME
|
||||||
--repo report github repo for NAME
|
--repo report github repo for NAME
|
||||||
|
|
@ -23,6 +28,8 @@ Options:
|
||||||
Will use NAME/.build as build directory
|
Will use NAME/.build as build directory
|
||||||
--build run cmake build for xo library NAME in immediate subdir
|
--build run cmake build for xo library NAME in immediate subdir
|
||||||
--install run cmake install for xo library NAME in immediate subdir
|
--install run cmake install for xo library NAME in immediate subdir
|
||||||
|
-S=SOURCEDIR override path/to/source
|
||||||
|
-B=BUILDDIR override path/to/build
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,6 +40,8 @@ clone_flag=0
|
||||||
configure_flag=0
|
configure_flag=0
|
||||||
build_flag=0
|
build_flag=0
|
||||||
install_flag=0
|
install_flag=0
|
||||||
|
pathtosource=
|
||||||
|
pathtobuild=
|
||||||
|
|
||||||
while [[ $# > 0 ]]; do
|
while [[ $# > 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
@ -45,6 +54,20 @@ while [[ $# > 0 ]]; do
|
||||||
-n)
|
-n)
|
||||||
noop_flag=1
|
noop_flag=1
|
||||||
;;
|
;;
|
||||||
|
-S)
|
||||||
|
shift
|
||||||
|
pathtosource=$1
|
||||||
|
;;
|
||||||
|
-S=*)
|
||||||
|
pathtosource="${1#*=}"
|
||||||
|
;;
|
||||||
|
-B)
|
||||||
|
shift
|
||||||
|
pathtobuild=$1
|
||||||
|
;;
|
||||||
|
-B=*)
|
||||||
|
pathtobuild="${1#*=}"
|
||||||
|
;;
|
||||||
--list)
|
--list)
|
||||||
cmd='list'
|
cmd='list'
|
||||||
;;
|
;;
|
||||||
|
|
@ -78,21 +101,20 @@ while [[ $# > 0 ]]; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo xoname=$xoname pathtosource=$pathtosource pathtobuild=$pathtobuild
|
||||||
|
|
||||||
|
if [[ -z "$pathtosource" ]]; then
|
||||||
|
pathtosource=$xoname
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$pathtobuild" ]]; then
|
||||||
|
pathtobuild=$xoname/.build
|
||||||
|
fi
|
||||||
|
|
||||||
|
SUBSYSTEMLIST_FILE=@CMAKE_INSTALL_FULL_DATADIR@/etc/xo/subsystem-list
|
||||||
|
|
||||||
subsystem_list() {
|
subsystem_list() {
|
||||||
cat <<EOF
|
cat ${SUBSYSTEMLIST_FILE}
|
||||||
xo-cmake
|
|
||||||
xo-indentlog
|
|
||||||
xo-refcnt
|
|
||||||
xo-subsys
|
|
||||||
xo-ratio
|
|
||||||
xo-reflect
|
|
||||||
xo-pyutil
|
|
||||||
xo-pyreflect
|
|
||||||
xo-expression
|
|
||||||
xo-pyexpression
|
|
||||||
xo-jit
|
|
||||||
xo-pyjit
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XO_REPO_STEM="https://github.com/Rconybea"
|
XO_REPO_STEM="https://github.com/Rconybea"
|
||||||
|
|
@ -101,9 +123,6 @@ repo() {
|
||||||
xoname=$1
|
xoname=$1
|
||||||
|
|
||||||
case "$xoname" in
|
case "$xoname" in
|
||||||
xo-cmake)
|
|
||||||
echo "${XO_REPO_STEM}/xo-cmake.git"
|
|
||||||
;;
|
|
||||||
xo-indentlog)
|
xo-indentlog)
|
||||||
echo "${XO_REPO_STEM}/indentlog.git"
|
echo "${XO_REPO_STEM}/indentlog.git"
|
||||||
;;
|
;;
|
||||||
|
|
@ -113,33 +132,16 @@ repo() {
|
||||||
xo-subsys)
|
xo-subsys)
|
||||||
echo "${XO_REPO_STEM}/subsys.git"
|
echo "${XO_REPO_STEM}/subsys.git"
|
||||||
;;
|
;;
|
||||||
xo-ratio)
|
|
||||||
echo "${XO_REPO_STEM}/xo-ratio.git"
|
|
||||||
;;
|
|
||||||
xo-reflect)
|
xo-reflect)
|
||||||
echo "${XO_REPO_STEM}/reflect.git"
|
echo "${XO_REPO_STEM}/reflect.git"
|
||||||
;;
|
;;
|
||||||
xo-pyutil)
|
|
||||||
echo "${XO_REPO_STEM}/xo-pyutil.git"
|
|
||||||
;;
|
|
||||||
xo-pyreflect)
|
|
||||||
echo "${XO_REPO_STEM}/xo-pyreflect.git"
|
|
||||||
;;
|
|
||||||
xo-expression)
|
|
||||||
echo "${XO_REPO_STEM}/xo-expression.git"
|
|
||||||
;;
|
|
||||||
xo-pyexpression)
|
|
||||||
echo "${XO_REPO_STEM}/xo-pyexpression.git"
|
|
||||||
;;
|
|
||||||
xo-jit)
|
|
||||||
echo "${XO_REPO_STEM}/xo-jit.git"
|
|
||||||
;;
|
|
||||||
xo-pyjit)
|
|
||||||
echo "${XO_REPO_STEM}/xo-pyjit.git"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "$0: unknown xo component [${xoname}]"
|
if grep -q $1 ${SUBSYSTEMLIST_FILE}; then
|
||||||
return 1
|
echo "${XO_REPO_STEM}/${1}.git"
|
||||||
|
else
|
||||||
|
>&2 echo "$0: unknown xo component [${xoname}]"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
esac
|
esac
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
@ -183,7 +185,7 @@ fi
|
||||||
|
|
||||||
if [[ $configure_flag -eq 1 ]]; then
|
if [[ $configure_flag -eq 1 ]]; then
|
||||||
if [[ -n "$xoname" ]]; then
|
if [[ -n "$xoname" ]]; then
|
||||||
cmd="cmake -DCMAKE_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ -S $xoname -B $xoname/.build"
|
cmd="cmake -DCMAKE_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ -S $pathtosource -B $pathtobuild"
|
||||||
|
|
||||||
if [[ $noop_flag -eq 1 ]]; then
|
if [[ $noop_flag -eq 1 ]]; then
|
||||||
echo $cmd
|
echo $cmd
|
||||||
|
|
@ -195,7 +197,7 @@ fi
|
||||||
|
|
||||||
if [[ $build_flag -eq 1 ]]; then
|
if [[ $build_flag -eq 1 ]]; then
|
||||||
if [[ -n "$xoname" ]]; then
|
if [[ -n "$xoname" ]]; then
|
||||||
cmd="cmake --build $xoname/.build -j"
|
cmd="cmake --build $pathtobuild -j"
|
||||||
|
|
||||||
if [[ $noop_flag -eq 1 ]]; then
|
if [[ $noop_flag -eq 1 ]]; then
|
||||||
echo $cmd
|
echo $cmd
|
||||||
|
|
@ -207,7 +209,7 @@ fi
|
||||||
|
|
||||||
if [[ $install_flag -eq 1 ]]; then
|
if [[ $install_flag -eq 1 ]]; then
|
||||||
if [[ -n "$xoname" ]]; then
|
if [[ -n "$xoname" ]]; then
|
||||||
cmd="cmake --install $xoname/.build"
|
cmd="cmake --install $pathtobuild"
|
||||||
|
|
||||||
if [[ $noop_flag -eq 1 ]]; then
|
if [[ $noop_flag -eq 1 ]]; then
|
||||||
echo $cmd
|
echo $cmd
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "$0 [-u|--usage|-h|--help|--lcov-exe|--genhtml-exe|--lcov-harness-exe|--gen-ccov-template|--cmake-module-path]" 1>&2
|
echo "$0 [-u|--usage|-h|--help|--lcov-exe|--genhtml-exe|--lcov-harness-exe|--gen-ccov-template|--cmake-module-path|--subsystem-list]" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
|
|
@ -20,6 +20,7 @@ Options:
|
||||||
--lcov-harness-exe report path to 'xo-cmake-lcov-harness' executable
|
--lcov-harness-exe report path to 'xo-cmake-lcov-harness' executable
|
||||||
--gen-ccov-template report path to 'gen-ccov.in' template
|
--gen-ccov-template report path to 'gen-ccov.in' template
|
||||||
--doxygen-template report path to 'Doxyfile.in' template
|
--doxygen-template report path to 'Doxyfile.in' template
|
||||||
|
--subsystem-list report path to 'subsystem-ilst'
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
@ -50,6 +51,9 @@ while [[ $# > 0 ]]; do
|
||||||
--doxygen-template)
|
--doxygen-template)
|
||||||
cmd='doxygen_template'
|
cmd='doxygen_template'
|
||||||
;;
|
;;
|
||||||
|
--subsystem-list)
|
||||||
|
cmd='subsystem_list'
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -77,4 +81,6 @@ elif [[ $cmd == 'gen_ccov_template' ]]; then
|
||||||
echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in
|
echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in
|
||||||
elif [[ $cmd == 'doxygen_template' ]]; then
|
elif [[ $cmd == 'doxygen_template' ]]; then
|
||||||
echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/Doxyfile.in
|
echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/Doxyfile.in
|
||||||
|
elif [[ $cmd == 'subsystem_list' ]]; then
|
||||||
|
echo -n @CMAKE_INSTALL_FULL_DATADIR@/etc/xo/subsystem-list
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
38
etc/xo/subsystem-list
Normal file
38
etc/xo/subsystem-list
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
xo-cmake
|
||||||
|
xo-indentlog
|
||||||
|
xo-refcnt
|
||||||
|
xo-subsys
|
||||||
|
xo-randomgen
|
||||||
|
xo-ordinaltree
|
||||||
|
xo-pyutil
|
||||||
|
xo-flatstring
|
||||||
|
xo-reflectutil
|
||||||
|
xo-reflect
|
||||||
|
xo-pyreflect
|
||||||
|
xo-ratio
|
||||||
|
xo-unit
|
||||||
|
xo-pyunit
|
||||||
|
xo-expression
|
||||||
|
xo-pyexpression
|
||||||
|
xo-tokenizer
|
||||||
|
xo-reader
|
||||||
|
xo-jit
|
||||||
|
xo-pyjit
|
||||||
|
xo-callback
|
||||||
|
xo-webutil
|
||||||
|
xo-pywebutil
|
||||||
|
xo-printjson
|
||||||
|
xo-pyprintjson
|
||||||
|
xo-reactor
|
||||||
|
xo-pyreactor
|
||||||
|
xo-websock
|
||||||
|
xo-pywebsock
|
||||||
|
xo-statistics
|
||||||
|
xo-distribution
|
||||||
|
xo-pydistribution
|
||||||
|
xo-simulator
|
||||||
|
xo-pysimulator
|
||||||
|
xo-process
|
||||||
|
xo-pyprocess
|
||||||
|
xo-kalmanfilter
|
||||||
|
xo-pykalmanfilter
|
||||||
Loading…
Add table
Add a link
Reference in a new issue