[Cmake] Set project defaults that are still accessible from the ccmake GUI?

William A. Hoffman billlist at nycap.rr.com
Thu, 29 Apr 2004 07:58:18 -0400


The only way to do this is to create a new project specific variable.
Something like this:

SET(MY_BUILD_TYPE RelWithDebInfo CACHE STRING "Used instead of CMAKE_BUILD_TYPE")
SET(CMAKE_BUILD_TYPE ${MY_BUILD_TYPE} CACHE STRING "..." FORCE)
MARK_AS_ADVANCED(CMAKE_BUILD_TYPE )


-Bill


At 04:48 PM 4/28/2004, Zachary Pincus wrote:
>Hello,
>
>I'm trying to set up a few default settings for a project that both appear in the ccmake GUI and can be overridden by the users. This doesn't seem like it should be too hard, but I can't get it working.
>
>For example,
>SET(CMAKE_BUILD_TYPE RelWithDebInfo)
>doesn't work -- RelWithDebInfo doesn't show up in the GUI under CMAKE_BUILD_TYPE, and the GUI's value is always overridden.
>
>So I try
>SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "...")
>but that doesn't work either. "RelWithDebInfo" doesn't show up in the ccmake GUI. When I build, the build type is *not* RelWithDebInfo. On the plus side, values set by the user in the GUI are respected.
>
>So I try
>SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "..." FORCE)
>but that still doesn't work. "RelWithDebInfo" now shows up in the ccmake GUI, but values set by the user in the GUI are overwritten.
>
>Is there any simple way to provide a default value for a cmake-standard variable?
>
>Zach Pincus
>
>Department of Biochemistry and Program in Biomedical Informatics
>Stanford University School of Medicine
>
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake