[CMake] What is the default build type?

Mueller-Roemer, Johannes Sebastian Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de
Fri Aug 4 02:50:14 EDT 2017


Exactly. Also, CMAKE_CONFIGURATION_TYPES uses the CamelCase Versions by default, so if your CMake code breaks with that spelling, your CMakeLists.txt can be considered broken anyways...

Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany
Tel +49 6151 155-606  |  Fax +49 6151 155-139
johannes.mueller-roemer at igd.fraunhofer.de | www.igd.fraunhofer.de


-----Original Message-----
From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Marcus D. Hanwell
Sent: Thursday, August 3, 2017 16:25
To: J Decker <d3ck0r at gmail.com>
Cc: cmake at cmake.org
Subject: Re: [CMake] What is the default build type?

On Wed, Aug 2, 2017 at 4:18 PM, J Decker <d3ck0r at gmail.com> wrote:
>
> On Wed, Aug 2, 2017 at 8:55 AM, Marcus D. Hanwell <marcus.hanwell at kitware.com> wrote:
>>
>> On Wed, Aug 2, 2017 at 3:03 AM, Bo Zhou <bo.schwarzstein at gmail.com> wrote:
>>>
>>> It depends on the Generator.
>>>
>>> To the Makefile, the actual type was controlled by the compiler options. If you don't specific any type, usually it means non-debug and non-optimization because the CMAKE_CXX_FLAGS is empty as default. This is critical, so usually people should specific the actual type they want to build.
>>>
>>> To the generator of the IDE, such as Visual Studio and Xcode, the CMAKE_BUILD_TYPE doesn't make sense but we have to use CMAKE_CONFIGURATION_TYPES, then CMake will create the several configuration sets for the IDE from the CMAKE_C|CXX_FLAGS_{CONFIG} .
>>
>>
>> This thread inspired me to write up how we have been doing it in some 
>> of the projects I work on for quite a while now,
>>
>> https://blog.kitware.com/cmake-and-the-default-build-type/
>>
> These should use lower case 'debug' 'release' etc.  Because if it's not VS, it's probably also not windows, and case matters.
>
No, camel case works just fine. I took a quick look and lowercase will work, as well as all caps. I have used this for many years on Linux builds with Makefile/Ninja without issue.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


More information about the CMake mailing list