Closed GoogleCodeExporter closed 9 years ago
I don't work on a Unix environment, so I need some help to fix this.
Original comment by erinca...@gmail.com
on 28 Mar 2011 at 6:48
This link might help, I hope its not outdated:
http://www.cmake.org/pipermail/cmake/2008-September/023808.html
tl;dr
This is what your looking for:
#
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their
definition
# and dump it in the cache along with proper documentation, otherwise set
CMAKE_BUILD_TYPE
# to Debug prior to calling PROJECT()
#
IF(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of
build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug
Release RelWithDebInfo MinSizeRel.")
ELSE()
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build,
options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release
RelWithDebInfo MinSizeRel.")
ENDIF()
PROJECT(foo)
ADD_EXECUTABLE(foo foo.cc)
#
Original comment by da...@develo.us
on 19 Apr 2011 at 9:26
I _may_ have misused "tl;dr" :P
Original comment by da...@develo.us
on 19 Apr 2011 at 9:32
fwiw here is my experience (fedora14):
A fresh checkout, with no command-line options the build type is release.
Build types can be switched between as mentioned above with "cmake
-DCMAKE_BUILD_TYPE=xxx", and this gets cached so it's a sticky setting.
I had always thought the default was release, so I'm wondering if the OP had
not already set his to debug at some point not realizing it was sticky. In any
case, the second piece of advice above also works, so if you wanted to wanted
to force the build type one way or the other for a fresh checkout with no
command line options, you could do that.
Original comment by iforc...@gmail.com
on 18 Jun 2011 at 3:05
The bottom of the that link has a quote that scares me:
"Hope this helps. Also, be aware it will not work on multiple solution
generators like for Visual Studio."
I'd rather steer clear of lots of platform specific stuff in the cmake files. I
chose cmake in the first place to get away from platform specific builds.
Original comment by erinca...@gmail.com
on 25 Jun 2011 at 11:33
Original issue reported on code.google.com by
slemb...@gmail.com
on 25 Feb 2011 at 6:07