-
Notifications
You must be signed in to change notification settings - Fork 52
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
CMakeLists.txt - Hide Unit Test related stuff behind option #171
base: master
Are you sure you want to change the base?
Conversation
Will check that today and give a feedback. But still if that commit would be fine I would suggest to hide all test related stuff behind an option that can be set by a top-level project. |
You are right the package is not required anymore and can be removed. Done in my PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems harmless to me, but also IMHO unnecessary. I don't know much about how we expect this library to be consumed. Does it really make sense for someone to want to consume this library without running its tests? And if they did, would they really do that by wholesale-importing the CMakeLists.txt that we wrote, instead of by just cutting and pasting the single .h file they were interested in?
CMakeLists.txt
Outdated
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
target_compile_options(${TEST_NAME} PRIVATE -Wall -Wextra -Werror) | ||
set_source_files_properties(${SG14_TEST_SOURCE_DIRECTORY}/plf_colony_test.cpp PROPERTIES | ||
COMPILE_FLAGS "-Wno-unused-parameter") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you uncuddle this parenthesis again, so that git show -b
will have one fewer gratuitous diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
One aim of modern cmake is to provide everything by target and target specific. Means to me: includes, flags, definitions, etc. |
Hide required package THREAD behind option to give the consumer the choice to only add the project interface target without any test dependencies.