On Mon, May 12, 2008 at 5:44 AM, no name <<a href="mailto:niezgod@gmail.com">niezgod@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello.<br><br>1. Actually my first question is simpler. How can I generate makefiles for debug/release configurations (which as far as I can understand should be possible in default)<br>I am generating makefiles with a command :<br>
<br>cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug .<br><br>then when I execute mingw32-make with created makefile and it seems to ignore enything regarding debug configuration. If I generate makefiles with -DCMAKE_BUILD_TYPE=Release genereted makefiles are exactly the same.</blockquote>
<div><br>That is surprising. What you did should work. I would verify the compiler flags are the same by typing "mingw32-make VERBOSE=1" at the command line.<br><br>Seems to generate the proper flags for me (on CMake 2.6.0), perhaps it's something you're doing in your CMakeLists?<br>
<br>Trivial CMakeLists.txt:<br>PROJECT(foo)<br>ADD_EXECUTABLE(foo foo.cc)<br><br>Running Cmake with -DCMAKE_BUILD_TYPE=Debug compiles like this:<br>C:\MinGW\bin\g++.exe -g -o CMakeFiles\foo.dir\foo.cc.obj -c "C:\Documents and Settings\Philip Lowman\test\foo.cc"<br>
<br>Running Cmake with -DCMAKE_BUILD_TYPE=Release compiles like this:<br>
C:\MinGW\bin\g++.exe -O3 -DNDEBUG -o CMakeFiles\foo.dir\foo.cc.obj -c "C:\Documents and Settings\Philip Lowman\test\foo.cc"<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>2. How to create new build type? For now I have this
<a href="http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_extend_the_build_modes_with_a_custom_made_one_.3F" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_extend_the_build_modes_with_a_custom_made_one_.3F</a>
from cmake faq which should solve the problem when I'll be able to
generate DIFFERENT makefiles for those configurations.</blockquote><div><br>That guide should work fine if you need a custom build solution using a single release configuration generator (aka the Makefile generator).<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">3. Is it possible to generate one makefile with separate targets for debug/release/myconfiguration ? The one that I could use like:<br>
<br>make debug<br>make release<br>
make my_configuration<br><br>I am using cmake version 2.6.</blockquote><div><br>Oddly enough I came across a feature request for this on the bugtracker a few days ago when I was investigating a rather interesting looking hot-pink colored bug.<br>
<a href="http://public.kitware.com/Bug/view.php?id=5946">http://public.kitware.com/Bug/view.php?id=5946</a><br><br>I'm not sure if this is even a feature that the CMake developers would be willing to add. It has been said on this mailing list plenty of times that it's very easy to work around the problem with out-of-source build directories. You can even use a shell script to automate stuff:<br>
<br>#!/bin/sh<br># A shell script in the root of your source tree.<br>mkdir build.debug<br>cd build.debug<br>cmake -DCMAKE_BUILD_TYPE=Debug ..<br>cd ..<br>mkdir build.release<br>cd build.release<br>cmake -DCMAKE_BUILD_TYPE=Release ..<br>
cd ..<br></div></div><br>-- <br>Philip Lowman