[CMake] Change optimization level for a particular XCode configuration

Keith Johnston keithj2 at gmail.com
Thu Jan 16 19:44:06 EST 2014


I am trying to change the optimization setting for a particular
configuration in the genreated XCode project, specifically the
"RelWithDebInfo" configuration. The default optimization level is "2" and I
would like it to be "3".

Here is my CMakeLists.txt
set(XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL[variant=RelWithDebInfo] 3)

project (Hello)
add_executable (Hello hello.c)

The generated project still has the optimization level set to "2". Is this
the correct way to override that setting?

I am using cmake version 2.8.12.1.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140116/44607e3d/attachment.html>


More information about the CMake mailing list