-
Notifications
You must be signed in to change notification settings - Fork 130
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
Beautify CMake messages #411
Conversation
Should In fact, should |
As you wish. I see |
I suggest doing something like (not tested, written in the Github editor):
So this leaves it "as-is" today but allows a "knowledgeable user" to silence this to the debug stream if necessary. |
Sure, I can agree with that. I guess then we need:
Does that seem like a reasonable enough list to you? |
Okay, will do!
Hm... As to me |
Hmm, why do you think that? The behaviour of a build that enables |
Just because this features mostly for developing, not like a regular feature for user. |
Nah, I don't agree with that -- a build without If you're happy, I think the above list a reasonable starting point. |
OK, I do not mind :)
How about to use CMAKE_MESSAGE_LOG_LEVEL instead? Personally, it seems to me that it is better to set this parameter from the command line / IDE settings, but we can change the default log level using this variable if you want. |
Could be too new 😞 I think @msoos's comment on 3.11 being fine is reasonable; I am not sure about 3.17 (I certainly don't want to bump to 3.17 just for This raises a good point ... do we need to bump the CMake version for |
😄
Bumping is not necessary, It's available in 3.3. |
How much do you care about changing these messages? I don't want to break some of the upstream projects that use STP (our main user is KLEE, which is currently at 3.5 🙀 ) Break is a strong term there: I want STP to work everywhere that KLEE works; if there are places where KLEE works and STP doesn't (because of CMake) that's a really dumb choice by us (== the STP project). |
Oh, got it. So even 3.11 is unavailable?
Or
Where I can leave with this. But can I suggest to use |
How about:
? |
Are you suggesting to use the same |
Yes, the developers of STP (e.g., me). I would actually argue that your approach of looking in the cache directly is significantly more advanced. |
Okay, I get it.
Sure, but two other suggested approaches should be fine. And you almost never need this information. Especially printing stuff like |
Does swapping Just so you know: I'm not trying to be difficult; I'm trying to find the middle-ground between sticking with an older CMake, not changing the interface the current STP development team use and making life better for you -- not always easy :) |
Yes! This is almost exactly what I suggesting, sorry If I confuse you. Will do it and update
Oh, totally understand 😄 |
I think we got distracted. Okay, so:
🚀 |
It is probably "abusive", but how about those warnings going into |
Do I understand correctly that you suggest to use feature summary instead of "found / not found" messages? For example, use only this: add_feature_info(CryptoMiniSat USE_CRYPTOMINISAT "Enables CryptoMiniSat solver, allows --cryptominisat5 option") and remove the following "found" messages: message(STATUS "Found CryptoMiniSat 5.x and C++11, allowing --cryptominisat5 option")
message(STATUS "CryptoMiniSat5 (5.0 or above) or C++11 support not found, not allowing --cryptominisat option") while keep other information if the library found, like
|
To me, that seems like it has some elegance and "improves" things (and hopefully makes life better for you). What do you think? I don't think we can solve the |
Agree, will look much nicer, will do! |
And so we'll do it for stuff that isn't "just" features? Like SANTIZE and TESTING? This was the "abusive" part. |
Sure, going to add a summary for every item in the following list:
|
Won't things like
Same for
|
Going to replace the following: if ((NOT DEFINED ENABLE_PYTHON_INTERFACE) OR ENABLE_PYTHON_INTERFACE)
find_package (PythonInterp)
if (PYTHON_EXECUTABLE)
set(PYTHON_OK ON)
message(STATUS "OK, found python interpreter")
else()
message(WARNING "Cannot find python interpreter, cannot build python interface")
endif()
if (PYTHON_OK AND BUILD_SHARED_LIBS)
message(STATUS "Python found, enabling python interface")
set(ENABLE_PYTHON_INTERFACE ON)
endif()
endif() with if((NOT DEFINED ENABLE_PYTHON_INTERFACE) OR ENABLE_PYTHON_INTERFACE)
find_package(PythonInterp)
if(PYTHON_EXECUTABLE AND BUILD_SHARED_LIBS)
set(ENABLE_PYTHON_INTERFACE ON)
endif()
endif()
add_feature_info(PythonInterface ENABLE_PYTHON_INTERFACE "Enables Python interface") What do you think?
Similar here, going to represent it as a build "feature". Is it okay? |
Don't we need an |
Yes. Good catch! |
Anyway, what you've shared is correct ... as long as the logic is correct :p |
I need to play with this, but it seems like the changes look good. Do you they achieve what you hoped to achieve? Do they solve the "why are these messages WARNINGS?" for you? |
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.
Tried it; works great!
One minor comment (well, a minor comment that applies to all of add_feature_info
calls).
Yes, warnings were the main reason if this PR! |
@Shatur are we good? Happy for me to merge? |
@andrewvaughanj yes, totally! |
🚀 |
Thanks, @Shatur! |
Thank you too! |
@andrewvaughanj, I realized that to use |
At the moment,
stp
can be conveniently used together with FetchContent in other projects.But CMake output from
stp
a bit noisy. And can be confusing for other developers, because they can see warning messages like "Testing is disabled" that comes fromstp
and unrelated their projects.In this PR I changed messages type from
STATUS
toDEBUG
because the information like "Boost -- adding '${Boost_LIBRARY_DIRS}' to link directories" is for thestp
developers. The documentation says that the purpose ofDEBUG
is "Detailed informational messages intended for developers working on the project itself as opposed to users who just want to build it.". So looks like a good fit to me because usually the official modules (which are provided by CMake itself) don't print that much information.To provide the information about what things are included, I used FeatureSummary.