Re: building everything with a set of specific preprocessor token(s)/definition(s)?
Boudhayan Gupta wrote: Sorry, I've been overlooking this thread completely (been going through a bit of a rough patch in life). > > CC="gcc -DWHATEVER_DEFINE" cmake ... > > It really should be as simple as that. Yeah, except that this would very likely apply too: > There's also an interaction with the build system I'm targeting; not really relevant on here but it does make it less trivial to rely on settings passed through the environment. I've also done this kind of thing in the past when using CFLAGS or CXXFLAGS didn't have the intended effect. YMMV, and I cannot recall if I ever tried this with cmake, but I've learned to avoid this approach (or use a wrapper that adds the desired options) because I've seen a bit too many cases where something would fail during the initial compiler tests. That build system I'm targeting (indeed, MacPorts) would apply the setting in one of its "header files" that provide the basic settings for any number of so- called "ports" for packages that are to be built with those settings. I won't be the only one developing such ports, so I'm looking for something that's as robust as possible against operator oversight. I realise this probably doesn't make much sense for most of you. Suffice it to say that things would have been really easier if cmake had a way to add elements to its variables via the command line. R. ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
building everything with a set of specific preprocessor token(s)/definition(s)?
Hi, I'd like to investigate something Qt-related that would require me to build all frameworks with a specific set of preprocessor tokens defined. Rather than patching all toplevel CMake files I'm hoping for way to define those tokens in the cmake invocation, IOW on the cmake command line. It seems CMake itself doesn't make that easy because of a lack incremental mechanisms, but maybe there's a hook in the ECM that I've overlooked? Thanks, René ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: building everything with a set of specific preprocessor token(s)/definition(s)?
On 14 February 2016 at 19:31, René J.V.wrote: > Hi, > > I'd like to investigate something Qt-related that would require me to build > all frameworks with a specific set of preprocessor tokens defined. Rather > than patching all toplevel CMake files I'm hoping for way to define those > tokens in the cmake invocation, IOW on the cmake command line. > It seems CMake itself doesn't make that easy because of a lack incremental > mechanisms, but maybe there's a hook in the ECM that I've overlooked? > > Thanks, > René CC="gcc -DWHATEVER_DEFINE" cmake ... It really should be as simple as that. ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: building everything with a set of specific preprocessor token(s)/definition(s)?
On Sunday 14 February 2016 15:01:43 René J.V. Bertin wrote: > Hi, > > I'd like to investigate something Qt-related that would require me to build > all frameworks with a specific set of preprocessor tokens defined. Rather > than patching all toplevel CMake files I'm hoping for way to define those > tokens in the cmake invocation, IOW on the cmake command line. > It seems CMake itself doesn't make that easy because of a lack incremental > mechanisms, but maybe there's a hook in the ECM that I've overlooked? export CXXFLAGS="-DMYDEFINE=1" before running cmake should do the trick. -- David Faure, fa...@kde.org, http://www.davidfaure.fr Working on KDE Frameworks 5 ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: building everything with a set of specific preprocessor token(s)/definition(s)?
On 14 February 2016 at 22:00, René J.V.wrote: > On Sunday February 14 2016 15:20:14 David Faure wrote: > >> export CXXFLAGS="-DMYDEFINE=1" before running cmake should do the trick. > > That's what I'm using ATM, but cmake has a nasty habit of not taking the > user's full CXXFLAGS and/or adding its own stuff to the resulting > CMAKE_CXX_COMPILER_FLAGS_XXX, depending on what build type you're using. > > There's also an interaction with the build system I'm targeting; not really > relevant on here but it does make it less trivial to rely on settings passed > through the environment. Hence my idea of using CC/CXX rather than the *FLAGS env-vars. -- Boudhayan Gupta ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: building everything with a set of specific preprocessor token(s)/definition(s)?
On Sunday February 14 2016 15:20:14 David Faure wrote: > export CXXFLAGS="-DMYDEFINE=1" before running cmake should do the trick. That's what I'm using ATM, but cmake has a nasty habit of not taking the user's full CXXFLAGS and/or adding its own stuff to the resulting CMAKE_CXX_COMPILER_FLAGS_XXX, depending on what build type you're using. There's also an interaction with the build system I'm targeting; not really relevant on here but it does make it less trivial to rely on settings passed through the environment. R. ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel