Skip to content

Commit

Permalink
Feat/tdl integration (#94)
Browse files Browse the repository at this point in the history
[FEATURE] tdl integration
  • Loading branch information
SGSSGene authored May 3, 2023
1 parent 239b004 commit fdb4e98
Show file tree
Hide file tree
Showing 21 changed files with 871 additions and 38 deletions.
1 change: 1 addition & 0 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
with:
path: sharg
fetch-depth: 1
submodules: true

# To reuse scripts
- name: Checkout SeqAn3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
with:
path: sharg
fetch-depth: ${{ steps.fetch_depth.outputs.depth }}
submodules: true

# To reuse scripts
- name: Checkout SeqAn3
Expand Down Expand Up @@ -115,7 +116,7 @@ jobs:
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSHARG_VERBOSE_TESTS=OFF \
-DSHARG_COVERAGE_PARALLEL_LEVEL=2
make -j2 gtest_build
make -j2 gtest_build yaml-cpp
- name: Build tests
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
with:
path: sharg
fetch-depth: 1
submodules: true

# To reuse scripts
- name: Checkout SeqAn3
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
cmake ../sharg/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSHARG_VERBOSE_TESTS=OFF
make -j2 gtest_build
make -j2 gtest_build yaml-cpp
- name: Build tests
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
with:
path: sharg
fetch-depth: 1
submodules: true

# To reuse scripts
- name: Checkout SeqAn3
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
cmake ../sharg/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSHARG_VERBOSE_TESTS=OFF
make -j3 gtest_build
make -j3 gtest_build yaml-cpp
- name: Build tests
env:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
with:
path: sharg
fetch-depth: 1
submodules: true

# To reuse scripts
- name: Checkout SeqAn3
Expand Down Expand Up @@ -159,8 +160,8 @@ jobs:
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSHARG_VERBOSE_TESTS=OFF
case "${{ matrix.build }}" in
snippet) make -j${{ matrix.build_threads }} gtest_build;;
header) make -j${{ matrix.build_threads }} gtest_build gbenchmark_build;;
snippet) make -j${{ matrix.build_threads }} gtest_build yaml-cpp;;
header) make -j${{ matrix.build_threads }} gtest_build gbenchmark_build yaml-cpp;;
documentation) make -j${{ matrix.build_threads }} download-cppreference-doxygen-web-tag;;
esac
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

# To reuse scripts
- name: Checkout SeqAn3
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "submodules/tool_description_lib"]
path = submodules/tool_description_lib
url = https://github.com/deNBI-cibi/tool_description_lib.git
43 changes: 30 additions & 13 deletions build_system/sharg-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ endmacro ()
# Note that sharg-config.cmake can be standalone and thus SHARG_CLONE_DIR might be empty.
# * `SHARG_CLONE_DIR` was already found in sharg-config-version.cmake
# * `SHARG_INCLUDE_DIR` was already found in sharg-config-version.cmake
find_path (SHARG_SUBMODULES_DIR NAMES lib/seqan3 HINTS "${SHARG_CLONE_DIR}" "${SHARG_INCLUDE_DIR}/sharg")
find_path (SHARG_SUBMODULES_DIR NAMES submodules/tool_description_lib HINTS "${SHARG_CLONE_DIR}" "${SHARG_INCLUDE_DIR}/sharg")

if (SHARG_INCLUDE_DIR)
sharg_config_print ("SHARG include dir found: ${SHARG_INCLUDE_DIR}")
Expand All @@ -134,15 +134,16 @@ if (SHARG_CLONE_DIR)
sharg_config_print ("Detected as running from a repository checkout…")
endif ()

if (SHARG_SUBMODULES_DIR)
file (GLOB submodules ${SHARG_SUBMODULES_DIR}/lib/*/include)
foreach (submodule ${submodules})
if (IS_DIRECTORY ${submodule})
sharg_config_print (" …adding submodule include: ${submodule}")
set (SHARG_DEPENDENCY_INCLUDE_DIRS ${submodule} ${SHARG_DEPENDENCY_INCLUDE_DIRS})
endif ()
endforeach ()
endif ()
# Currently unused.
# if (SHARG_SUBMODULES_DIR)
# file (GLOB submodules ${SHARG_SUBMODULES_DIR}/lib/*/include)
# foreach (submodule ${submodules})
# if (IS_DIRECTORY ${submodule})
# sharg_config_print (" …adding submodule include: ${submodule}")
# set (SHARG_DEPENDENCY_INCLUDE_DIRS ${submodule} ${SHARG_DEPENDENCY_INCLUDE_DIRS})
# endif ()
# endforeach ()
# endif ()

# ----------------------------------------------------------------------------
# Options for CheckCXXSourceCompiles
Expand Down Expand Up @@ -211,6 +212,22 @@ else ()
sharg_config_print ("Thread support: not found.")
endif ()

# ----------------------------------------------------------------------------
# tool description lib (tdl) dependency
# ----------------------------------------------------------------------------

set (STORED_CMAKE_MESSAGE_LOG_LEVEL "${CMAKE_MESSAGE_LOG_LEVEL}")
set (CMAKE_MESSAGE_LOG_LEVEL "ERROR")
find_package (TDL QUIET HINTS ${SHARG_SUBMODULES_DIR}/submodules/tool_description_lib ${SHARG_HINT_TDL})
set (CMAKE_MESSAGE_LOG_LEVEL "${STORED_CMAKE_MESSAGE_LOG_LEVEL}")
unset (STORED_CMAKE_MESSAGE_LOG_LEVEL)

if (TDL_FOUND)
sharg_config_print ("Dependency: TDL found.")
else ()
sharg_config_error ("Dependency: TDL not found.")
endif ()

# ----------------------------------------------------------------------------
# ZLIB dependency
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -297,9 +314,9 @@ try_compile (SHARG_PLATFORM_TEST
OUTPUT_VARIABLE SHARG_PLATFORM_TEST_OUTPUT)

if (SHARG_PLATFORM_TEST)
sharg_config_print ("SHARG platform.hpp build: passed.")
sharg_config_print ("SHARG platform.hpp build: passed.")
else ()
sharg_config_error ("SHARG platform.hpp build: failed!\n\
sharg_config_error ("SHARG platform.hpp build: failed!\n\
${SHARG_PLATFORM_TEST_OUTPUT}")
endif ()

Expand Down Expand Up @@ -329,7 +346,7 @@ if (SHARG_FOUND AND NOT TARGET sharg::sharg)
add_library (sharg_sharg INTERFACE)
target_compile_definitions (sharg_sharg INTERFACE ${SHARG_DEFINITIONS})
target_compile_options (sharg_sharg INTERFACE ${SHARG_CXX_FLAGS_LIST})
target_link_libraries (sharg_sharg INTERFACE "${SHARG_LIBRARIES}")
target_link_libraries (sharg_sharg INTERFACE "${SHARG_LIBRARIES}" tdl::tdl)
# include sharg/include/ as -I, because sharg should never produce warnings.
target_include_directories (sharg_sharg INTERFACE "${SHARG_INCLUDE_DIR}")
# include everything except sharg/include/ as -isystem, i.e.
Expand Down
2 changes: 1 addition & 1 deletion include/sharg/detail/format_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class format_help_base : public format_base
derived_t().print_list_item("\\fB--version\\fP", "Prints the version information.");
derived_t().print_list_item("\\fB--copyright\\fP", "Prints the copyright/license information.");
derived_t().print_list_item("\\fB--export-help\\fP (std::string)",
"Export the help page information. Value must be one of [html, man].");
"Export the help page information. Value must be one of [html, man, ctd, cwl].");
if (version_check_dev_decision == update_notifications::on)
derived_t().print_list_item("\\fB--version-check\\fP (bool)",
"Whether to check for the newest app version. Default: true.");
Expand Down
Loading

1 comment on commit fdb4e98

@vercel
Copy link

@vercel vercel bot commented on fdb4e98 May 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sharg-parser – ./

sharg-100.vercel.app
sharg-parser-git-main-seqan.vercel.app
sharg.vercel.app
sharg-parser-seqan.vercel.app

Please sign in to comment.