How to add compile-flags to config (solving another problem of WxWidgets missing setup.h" Follow
I'm trying to add in `WxWidgets` to my code, and it's working on the command-line (so my installation of `WxWidgets` is verified).
/usr/bin/c++ main.cpp `wx-config --cxxflags` `wx-config --libs`
Those are compile-flags (sort of), based on https://wiki.wxwidgets.org/Wx-Config , however one is a compiler-flag, and one is a linker-flag. This forum-link https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001405200-How-to-add-gcc-compiler-flags-arguments-and-set-environment-variables addresses that, but only compiler-flags. Based on that, I haven't manager to get either flag actually added to the process. Thanks for any help.
Please sign in to leave a comment.
For linker flags there is CMAKE_EXE_LINKER_FLAGS. See https://stackoverflow.com/a/11797272/11988753 , for example.
Thanks for the information. Could you expand a bit on the syntax to pass in multiple-value parameters? I have tried several things, and not been able to get it to work. Example:
I tried variations on that, but haven't yet hit the magic formula. :)
Upon further reading, they're not actually multiple-value parameters, but a backtick-delimited command, to the `wx-config` executable part of `WxWidgets`. The actual result of those is this:
So the question could also be, how to incorporate an `-I/usr/lib...` set of directives, into the CMAKE file.
Happy to say I found an answer - it isn't required to pass in the full set of auto-generated flags, it turns out that https://stackoverflow.com/questions/68019574/how-to-include-wxwidgets-headers-in-cmake-project explains that
and the following code worked:
where `hello` is my own package, everything else is a directive to `WxWidgets`.