[CMake] Re: CMake Digest, Vol 35, Issue 6

ElderOrb elderorb at gmail.com
Sun Mar 4 14:46:47 EST 2007


crco> ------------------------------

crco> Message: 6
crco> Date: Sun, 4 Mar 2007 11:30:33 +0200
crco> From: ElderOrb <elderorb at gmail.com>
crco> Subject: [CMake] adding and removing build configuration types
crco> To: cmake at cmake.org
crco> Message-ID: <45627698.20070304113033 at gmail.com>
crco> Content-Type: text/plain; charset=Windows-1251

crco> Hello, cmake.

crco> There are 4 default build configurations defined by cmake: "debug",
crco> "release", "minSizeRel" and "relWithDebInfo". How to remove "minSizeRel"
crco> and "relWithDebInfo" and add "debug unicode" and "release unicode"?
crco> ("debug unicode" is just "debug" with -DZ_UNICODE definition, the same
crco> is true for "release unicode")

crco> I tried to play with CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE, read
crco> faq and had much googling - all without success.

crco> -- 
crco> Regards,
crco>  ElderOrb                          mailto:ElderOrb at gmail.com



crco> ------------------------------

crco> Message: 7
crco> Date: Sun, 04 Mar 2007 15:36:09 +0200
crco> From: "Ilya Shvetsov" <chvetsov at kranx.com>
crco> Subject: Re: [CMake] adding and removing build configuration types
crco> To: "cmake at cmake.org" <cmake at cmake.org>
crco> Message-ID: <op.ton2qjac4i1l99 at kbi.chief.kranx.com>
crco> Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8

crco> On Sun, 04 Mar 2007 11:30:33 +0200, ElderOrb <elderorb at gmail.com> wrote:

>> Hello, cmake.
>>
>> There are 4 default build configurations defined by cmake: "debug",
>> "release", "minSizeRel" and "relWithDebInfo". How to remove "minSizeRel"
>> and "relWithDebInfo" and add "debug unicode" and "release unicode"?
>> ("debug unicode" is just "debug" with -DZ_UNICODE definition, the same
>> is true for "release unicode")
>>
>> I tried to play with CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE, read
>> faq and had much googling - all without success.
>>

crco> http://www.cmake.org/Wiki/CMake_Useful_Variables

crco> Find description for CMAKE_BUILD_TYPE. It describes how to create new
crco> config.

crco> I removed successfully minSizeRel with command placed before PROJECT
crco> command

crco> set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo CACHE TYPE
crco> INTERNAL FORCE )

crco> Hope help you

Thank you! I've tested your solution and removing of minSizeRel works!
But how to add new configurations? I've tried to do the following:

..........

set(CMAKE_BUILD_TYPE Debug_Unicode)

set(CMAKE_CXX_FLAGS_DEBUG_UNICODE ${CMAKE_CXX_FLAGS_DEBUG} "-DZ_UNICODE")
set(CMAKE_C_FLAGS_DEBUG_UNICODE ${CMAKE_C_FLAGS_DEBUG} "-DZ_UNICODE")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG_UNICODE ${CMAKE_EXE_LINKER_FLAGS_DEBUG})
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG_UNICODE ${CMAKE_SHARED_LINKER_FLAGS_DEBUG})

set(CMAKE_BUILD_TYPE Release_Unicode)

set(CMAKE_CXX_FLAGS_RELEASE_UNICODE ${CMAKE_CXX_FLAGS_RELEASE} "-DZ_UNICODE")
set(CMAKE_C_FLAGS_RELEASE_UNICODE ${CMAKE_C_FLAGS_RELEASE} "-DZ_UNICODE")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_UNICODE ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE_UNICODE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE})

set(CMAKE_CONFIGURATION_TYPES Debug Release Debug_Unicode Release_Unicode CACHE TYPE INTERNAL FORCE)

project(Z)

.............

and got errors:

CMake Error: Invalid configuration type in CMAKE_CONFIGURATION_TYPES: Debug_Unic
ode (Valid types are Debug,Release,MinSizeRel,RelWithDebInfo)
CMake Error: Invalid configuration type in CMAKE_CONFIGURATION_TYPES: Release_Un
icode (Valid types are Debug,Release,MinSizeRel,RelWithDebInfo)

Where I wrong now ?

-- 
Regards,
 ElderOrb                          mailto:ElderOrb at gmail.com



More information about the CMake mailing list