Skip to content
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

Switching between release/ debug not possible #1303

Open
paroj opened this issue Oct 17, 2019 · 7 comments
Open

Switching between release/ debug not possible #1303

paroj opened this issue Oct 17, 2019 · 7 comments
Labels
💻 iOS / OS X 💻 Windows 🏭 CMake Known Issues easy workaround exists or too intrusive to fix right away

Comments

@paroj
Copy link
Member

paroj commented Oct 17, 2019

for multi-config generators, notably Xcode and MSVC, switching release/ debug builds is not possible.
This is due to the dependencies being installed with the config of the first build and not being rebuild accordingly.
The workaround for now is to use two build directories - one for release and one for debug.

example error messages:

LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'
LNK2038	mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug'
@paroj paroj added Known Issues easy workaround exists or too intrusive to fix right away 🏭 CMake labels Oct 17, 2019
@paroj paroj pinned this issue Mar 21, 2020
@MBetters

This comment was marked as duplicate.

@paroj
Copy link
Member Author

paroj commented Sep 19, 2020

to get a debug build, you must specify the build-type at configure time via CLI:

cmake.exe -DCMAKE_BUILD_TYPE=Debug ...

otherwise CMake just uses Release by default, but you only get to choose the type in the GUI after you hit configure.

@aldric-diamoco
Copy link

aldric-diamoco commented Mar 7, 2022

hello there, I ask myself, is it possible or is there anybody kind enough, and I know it's time consumming but it's important, just for helping newbies like me, to have a clear receipe, step by step, without considering that we know, a kind of tutorial about how to construct ogre fully and successfully with msvc 2019 both in debug, and release for everyone can enjoy this great (well it seems great ) framework. Can I say thank you in advance ? And may be ... please, command line only beacuse it seems cmake-gui will not be the good tool if I understand well, am I?

@aldric-diamoco

This comment was marked as resolved.

@creadmefford
Copy link
Contributor

hello there, I ask myself, is it possible or is there anybody kind enough, and I know it's time consumming but it's important, just for helping newbies like me, to have a clear receipe, step by step, without considering that we know, a kind of tutorial about how to construct ogre fully and successfully with msvc 2019 both in debug, and release for everyone can enjoy this great (well it seems great ) framework. Can I say thank you in advance ? And may be ... please, command line only beacuse it seems cmake-gui will not be the good tool if I understand well, am I?

I use cmake-gui (v 3.23.2+) and build release and debug separately just like paroj recommends above.

  1. use github to pull down the tag/version of ogre you want.
  2. for debug builds, open a command console window and type: set CMAKE_BUILD_TYPE=Debug. then from the same command window launch "C:\Program Files\CMake\bin\cmake-gui.exe". for release builds, just launch cmake-gui.exe from windows desktop / start menu (you don't need to set the environment variable or use the command window)
  3. if your ogre source is at d:\source\ogre3d\ogre then place the cmake output at d:\source\ogre3d\ogre\build\debug or d:\source\ogre3d\ogre\build\release.
    image
  4. hit configure in cmake and set CMAKE_BUILD_TYPE to Debug or Release. Same for CMAKE_CONFIGURATION_TYPES.
  5. configure ogre the way you want but you can take the defaults for the most part.
  6. generate your debug or release version of OGRE.SLN.
  7. start OGRE.SLN and rebuild the CMakePredefinedTargets->INSTALL.

@creadmefford
Copy link
Contributor

tested this yesterday with cmake 3.23.2 and ogre 13.4.0. (despite the screenshot saying 3.23.1)

@Lyoko-Jeremie

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 iOS / OS X 💻 Windows 🏭 CMake Known Issues easy workaround exists or too intrusive to fix right away
Projects
None yet
Development

No branches or pull requests

5 participants