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

Follow the cmake standard of BUILD_TESTING vs KDSingleApplication_TESTS #10

Open
TheOneRing opened this issue Jul 21, 2023 · 3 comments

Comments

@TheOneRing
Copy link

BUILD_TESTING is the more or less standard flag to enable tests.
Hiding the tests behind KDSingleApplication_TESTS is unintuitive.

@winterz
Copy link
Member

winterz commented Jul 21, 2023

Probably this is a WONTFIX. at least for now.
All our projects use namespaced cmake options so if we made this change we'd need to a lot of cmake options in a lot of projects.

@dfaure-kdab
Copy link
Member

dfaure-kdab commented Oct 4, 2023

The good thing about KDSingleApplication_TESTS is that it makes it easy to use KDSingleApplication as a submodule; if you want to build the unittests of the main repo, you don't necessarily want to build those of the 3rdparty libs.

However I can certainly see the benefit of supporting the standard BUILD_TESTING variable when KDSingleApplication is built as a standalone module.

So why don't we do something like this, in KDSingleApplication's own CMakeLists.txt?

if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}" AND BUILD_TESTING)
    set(KDSingleApplication_TESTS ON)
endif()

Untested.

@winterz
Copy link
Member

winterz commented Oct 9, 2023

I have no objection to that type of solution.

would be something to add to all our products, eventually. if we want to do that work.

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

3 participants