Giter Site home page Giter Site logo

Comments (11)

15knots avatar 15knots commented on August 22, 2024

Option -DCMAKE_BUILD_TYPE:STRING=Debug is passed if your CDT build configuration is of DEBUG type. Just create a new CDT build configuration which is neither derived from DEBUG nor RELEASE type and use that.

from cmake4eclipse.

Krakonos avatar Krakonos commented on August 22, 2024

Thanks. I tried that, but it seems I can only create new build configuration by deriving from others. The basic ones are Debug and Release, the others in "import" are in form of "Something > Debug" or "Something > Release". Deriving from them doesn't seem to do anything, as in "I can try to build it, but it has no effect, no directory is created, even the first time, and the build output contains specific parameters from the build I was trying before".

from cmake4eclipse.

15knots avatar 15knots commented on August 22, 2024

Concerning build configurations in the CDT UI, you are right. No chance to derive from nothing.

Why kind of workaround do you apply?.
If I set CMAKE_BUILD_TYPE to MySpecialBuildType on the CMake project settings Symbols tab, the CMake Console shows that that value is passed to cmake:
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_BUILD_TYPE:STRING=MySpecialBuildType -G "Unix Makefiles" ...
and in file /build/Debug/CMakeCache.txt I find the lines
//No help, variable specified on the command line. CMAKE_BUILD_TYPE:STRING=MySpecialBuildType

which is exactly what you might want.
Cmake simply ignores the first -DCMAKE_BUILD_TYPE:STRING=Debug option and none of the debug- or relase options is passed to the C-compiler. .

from cmake4eclipse.

15knots avatar 15knots commented on August 22, 2024

Closing this, since feedback was requested and no feedback arrived in more than one year. Re-open, if necessary.

from cmake4eclipse.

Krakonos avatar Krakonos commented on August 22, 2024

Sorry for that! I'm not using eclipse myself and a colleague of mine did resolve it somehow, I think using an external script. I didn't have time or motivation to dig further. Keep it closed and thanks for your help, it was very much appreciated!

from cmake4eclipse.

sliwowitz avatar sliwowitz commented on August 22, 2024

I've just spent a couple hours trying to find out where do the default CMAKE_BUILD_TYPE definitions come from, and how to change them in order to compile a RelWithDebInfo type build. I'm fine with deriving my configuration from the "Default" one which does not specify any build type (overriding just seems a bit unclean), but it is inconsistent - there's no place to see the parameters in the configuration tabs, so one as to guess at the "magic" at work.

The magic seems convenient enough for most use cases I guess, so I probably wouldn't argue for changing the default behavior, but can this behavior be documented? A hint at the symbols tab explaining which symbols are being defined by cmake4eclipse, or a checkbox to show predefined options similar to "Show system variables" option in the standard build variables tab? (Or at least mention that somewhere in the help pages)

from cmake4eclipse.

15knots avatar 15knots commented on August 22, 2024

I've just spent a couple hours trying to find out where do the default CMAKE_BUILD_TYPE definitions come from, and how to change them in order to compile a RelWithDebInfo type build. I'm fine with deriving my configuration from the "Default" one which does not specify any build type (overriding just seems a bit unclean), but it is inconsistent - there's no place to see the parameters in the configuration tabs, so one as to guess at the "magic" at work.

The symbols specified in the symbols tab override those specified by cmake4eclipse.
So to do a RelWithDebInfo type build, just add a symbol named CMAKE_BUILD_TYPE in the symbols tab and give it the value you want. This will work for any build configuration.

Cmake4clipse adds the CMAKE_BUILD_TYPE symbol just for user convenience.
You will see the defined symbols in the first line (the cmake command-line) in the build console.

The magic seems convenient enough for most use cases I guess, so I probably wouldn't argue for changing the default behavior, but can this behavior be documented? A hint at the symbols tab explaining which symbols are being defined by cmake4eclipse, or a checkbox to show predefined options similar to "Show system variables" option in the standard build variables tab? (Or at least mention that somewhere in the help pages)

Mentioning in the help pages sounds reasonable.

from cmake4eclipse.

DennisSchiefer avatar DennisSchiefer commented on August 22, 2024

For people that might run into the same problem:

When you create a new build configuration, choose "Import predefined". This gives you, among others, three "CMake driven" options: Debug, Release, Default. The first two hard-code Debug/Release as build type. The last one does not define a build type and you have to do it yourself.

from cmake4eclipse.

15knots avatar 15knots commented on August 22, 2024

from cmake4eclipse.

DennisSchiefer avatar DennisSchiefer commented on August 22, 2024

Yes, sorry. That works, too.
I just thought to bring it up, since some folks were confused which CMAKE_BUILD_TYPE would win if multiple show up on the command line (the latter) and the "Default" configuration (that I missed the first time around) handily avoids this question since it does not define a build type.

from cmake4eclipse.

inxksp avatar inxksp commented on August 22, 2024

Why can't you just pass the name of the current Eclipse configuration to CMAKE_BUILD_TYPE? This seems to be the most logical and convenient way.

from cmake4eclipse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.