[Bf-committers] WIN32 cmake flag

Campbell Barton ideasman42 at gmail.com
Wed Oct 26 01:53:03 CEST 2011


I think Thomas meant to define new CMake variables, not rename.

But don't really think this gains us much, sure we can do...

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    set(WINDOWS TRUE)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
    set(LINUX TRUE)
endif()

# then its convenient
if(WINDOWS) ...

... then we just have a list of non standard variables that map to cmake's.


CMAKE_CL_64 is only for MSVC, so BITNESS could be better for 64bit
intelc++, Mingw64 etc but these are not yet supported on windows so
cross that bridge when we come to it IMHO.


On Wed, Oct 26, 2011 at 9:52 AM, Erwin Coumans <erwin.coumans at gmail.com> wrote:
> What is the problem of using CMAKE_CL_64 to detect 64bit builds?
>
> As far as I know, WIN32 and CMAKE_CL_64
> are build-in CMAKE defaults, so they are not meant to be renamed.
>
> Thanks,
> Erwin
>
>
>
>
> On 25 October 2011 15:45, Campbell Barton <ideasman42 at gmail.com> wrote:
>
>> so far for windows we have been using CMAKE_CL_64 if this is needed
>> for other configurations we'd be better to define some global variable
>> like SCons BF_BITNESS,
>>
>> eg,
>>
>> if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
>>        set(BITNESS 64)
>> else()
>>        set(BITNESS 32)
>> endif()
>>
>>
>> For windows you can do...
>>
>> if(CMAKE_SYSTEM_NAME MATCHES "Windows")
>>    ....
>> endif()
>>
>>
>> While WIN32 is silly to define for win64 afaik we have the same
>> annoyance in the source code.
>>
>>
>> For more info see: http://cmake.org/Wiki/CMake_Useful_Variables
>>
>>
>> On Wed, Oct 26, 2011 at 5:18 AM, Thomas Dinges <blender at dingto.org> wrote:
>> > Hey,
>> > If I see that correct the checks in cmake, like "if(WIN32)", also apply
>> > to win64.
>> > Maybe this flag is from old x86 only days. Could we rename it to WIN or
>> > WINDOWS in general?
>> >
>> > Campbell? Any idea? I guess the same applies for scons. Thanks.
>> >
>> > Best regards,
>> > Thomas
>> >
>> > --
>> > Thomas Dinges
>> > Blender Developer, Artist and Musician
>> >
>> > www.dingto.org
>> >
>> > _______________________________________________
>> > Bf-committers mailing list
>> > Bf-committers at blender.org
>> > http://lists.blender.org/mailman/listinfo/bf-committers
>> >
>>
>>
>>
>> --
>> - Campbell
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list