diff --git a/bin/xo-build.in b/bin/xo-build.in index 4399932..378839a 100644 --- a/bin/xo-build.in +++ b/bin/xo-build.in @@ -3,8 +3,9 @@ usage() { cat < 0 ]]; do case "$1" in @@ -52,7 +62,7 @@ while [[ $# > 0 ]]; do -h | --help) cmd='help' ;; - -n) + -n | --dry-run) noop_flag=1 ;; -S) @@ -93,6 +103,15 @@ while [[ $# > 0 ]]; do --install) install_flag=1 ;; + --with-examples) + with_examples=1 + ;; + --with-utests) + with_utests=1 + ;; + --debug-build) + debug_build=1 + ;; xo-*) xoname="$1" ;; @@ -105,7 +124,7 @@ while [[ $# > 0 ]]; do shift done -echo xoname=$xoname pathtosource=$pathtosource pathtobuild=$pathtobuild +#echo xoname=$xoname pathtosource=$pathtosource pathtobuild=$pathtobuild if [[ -z "$pathtosource" ]]; then pathtosource=$xoname @@ -190,7 +209,22 @@ fi if [[ $configure_flag -eq 1 ]]; then if [[ -n "$xoname" ]]; then - cmd="cmake -DCMAKE_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ -DCMAKE_MODULE_PATH=@CMAKE_INSTALL_PREFIX@/share/cmake -S $pathtosource -B $pathtobuild" + testingarg= + if [[ $with_utests -eq 1 ]]; then + testingarg="-DENABLE_TESTING=1" + fi + + examplearg= + if [[ $with_examples -eq 1 ]]; then + examplearg="-DXO_ENABLE_EXAMPLES=1" + fi + + cmakebuildtype= + if [[ $debug_build -eq 1 ]]; then + cmakebuildtype="-DCMAKE_BUILD_TYPE=Debug" + fi + + cmd="cmake -DCMAKE_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ -DCMAKE_MODULE_PATH=@CMAKE_INSTALL_PREFIX@/share/cmake -S $pathtosource -B $pathtobuild ${testingarg} ${examplearg} ${cmakebuildtype}" if [[ $noop_flag -eq 1 ]]; then echo $cmd