[CMake] Re: custom build

Brandon Van Every bvanevery at gmail.com
Thu May 24 14:10:46 EDT 2007


As noted on the wiki http://www.cmake.org/Wiki/CMake_Useful_Variables

"Note that CMAKE_BUILD_TYPE is not initialized with a readable value at
configuration time. This is because the user is free to select a build type
at build time. Use CMAKE_CFG_INTDIR if you need a variable that evaluates to
the correct build time directory."

I do think it is regrettable, however, that CMAKE_BUILD_TYPE has this
behavior.  An unknowing user would expect it to have a useful value.

Cheers,
Brandon Van Every



On 5/24/07, Won-Ki Jeong <graphor at gmail.com> wrote:
>
> I tried that, but it does not seem to work. For example, I tried to
> set a different build flag as follows:
>
> IF(CMAKE_BUILD_TYPE MATCHES "Debug")
>   SET(buildFlag ${buildFlag} -g)
> ELSE(CMAKE_BUILD_TYPE MATCHES "Debug")
>   SET(buildFlag ${buildFlag} -O)
> ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
>
> but buildFlag is always set to "-O" no matter which build type I
> select. Is it because build type is set after CMake creates project
> file (for Visual Studio)? Is there any trick to do this?
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070524/9f2929fb/attachment.html


More information about the CMake mailing list