diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b7c1036..14226afa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,13 @@ install( 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; # to pickup downstream project's PROJECT_SOURCE_DIR / PROJECT_BINARY_DIR # diff --git a/bin/xo-build.in b/bin/xo-build.in index 49bbf4d6..194ce3df 100644 --- a/bin/xo-build.in +++ b/bin/xo-build.in @@ -1,7 +1,12 @@ #!/usr/bin/env bash usage() { - echo "$0 [-u|--usage|-h|--help] [--xoname=NAME] [--repo]" + cat < 0 ]]; do case "$1" in @@ -45,6 +54,20 @@ while [[ $# > 0 ]]; do -n) noop_flag=1 ;; + -S) + shift + pathtosource=$1 + ;; + -S=*) + pathtosource="${1#*=}" + ;; + -B) + shift + pathtobuild=$1 + ;; + -B=*) + pathtobuild="${1#*=}" + ;; --list) cmd='list' ;; @@ -78,21 +101,20 @@ while [[ $# > 0 ]]; do shift 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() { - cat <&2 echo "$0: unknown xo component [${xoname}]" + return 1 + fi esac return 0 @@ -183,7 +185,7 @@ fi if [[ $configure_flag -eq 1 ]]; 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 echo $cmd @@ -195,7 +197,7 @@ fi if [[ $build_flag -eq 1 ]]; then if [[ -n "$xoname" ]]; then - cmd="cmake --build $xoname/.build -j" + cmd="cmake --build $pathtobuild -j" if [[ $noop_flag -eq 1 ]]; then echo $cmd @@ -207,7 +209,7 @@ fi if [[ $install_flag -eq 1 ]]; then if [[ -n "$xoname" ]]; then - cmd="cmake --install $xoname/.build" + cmd="cmake --install $pathtobuild" if [[ $noop_flag -eq 1 ]]; then echo $cmd diff --git a/bin/xo-cmake-config.in b/bin/xo-cmake-config.in index 4950617e..bbea1361 100755 --- a/bin/xo-cmake-config.in +++ b/bin/xo-cmake-config.in @@ -1,7 +1,7 @@ #!/usr/bin/env bash 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() { @@ -20,6 +20,7 @@ Options: --lcov-harness-exe report path to 'xo-cmake-lcov-harness' executable --gen-ccov-template report path to 'gen-ccov.in' template --doxygen-template report path to 'Doxyfile.in' template + --subsystem-list report path to 'subsystem-ilst' EOF } @@ -50,6 +51,9 @@ while [[ $# > 0 ]]; do --doxygen-template) cmd='doxygen_template' ;; + --subsystem-list) + cmd='subsystem_list' + ;; *) usage exit 1 @@ -77,4 +81,6 @@ elif [[ $cmd == 'gen_ccov_template' ]]; then echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in elif [[ $cmd == 'doxygen_template' ]]; then 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 diff --git a/etc/xo/subsystem-list b/etc/xo/subsystem-list new file mode 100644 index 00000000..d1dcf6c7 --- /dev/null +++ b/etc/xo/subsystem-list @@ -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