Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST] App-template assumes exactly one binary. How do we treat several? #24

Open
Irallia opened this issue Oct 6, 2020 · 1 comment

Comments

@Irallia
Copy link
Contributor

Irallia commented Oct 6, 2020

The app-template assumes exactly one binary, but sometimes we have more. How do we want to deal with it?

In the iGenVar project, for example, we have two binaries. As a result, some CMakeLists do not work correctly.
In seqan/iGenVar#19 we got the Problem, that .../test/CMakeLists.txt with

    # Add the test to its general target (cli or api).
    if (${test_alternative} STREQUAL "CLI_TEST")
        add_dependencies (${target} "${PROJECT_NAME}") # cli test needs the application executable
        target_include_directories(${target} PUBLIC "${SEQAN3_CLONE_DIR}/test/include")
        add_dependencies (cli_test ${target})
    elseif (${test_alternative} STREQUAL "API_TEST")
        add_dependencies (api_test ${target})
    endif ()

the dependencies are not added correctly.

There are 3 ideas to fix this (using the example of iGenVar):

  • add_cli_test(detect_breakends_cli_test), this is always done automatically via naming conventions depended on detect_breakends -> update .../test/CMakeLists.txt
  • add_cli_test(detect_breakends_cli_test DEPENDS detect_breakends fastq_conversion), i.e. one says which binaries the test needs
  • or we add a line in each test, namely: add_dependencies (detect_breakends_cli_test "detect_breakends") and remove this part in iGenVar/test/CMakeLists.txt
@joergi-w
Copy link
Member

To me the second version seems the most intuitive one and in this way CMake automatically makes sure that dependent targets are available beforehand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants