Cmake on Windows

Discussion and help for Compilation problems and platform portability.

Moderators: Dade, coordinators

Cmake on Windows

Postby exvion » Tue Oct 20, 2009 5:31 am

I try to generate Visual Studio project from CMakeLists.txt. I use Cmake 2.6. I get error.
I propose to replace code
Code: Select all
#############################################################################
#############################################################################
### check for the CPU we build for                                        ###
#############################################################################
#############################################################################

EXECUTE_PROCESS(
    COMMAND ${CMAKE_C_COMPILER} -dumpmachine
    OUTPUT_VARIABLE MACHINE
    OUTPUT_STRIP_TRAILING_WHITESPACE
)
MESSAGE(STATUS "Building for target ${MACHINE}")

STRING(REGEX MATCH "(i.86-*)|(athlon-*)|(pentium-*)" _mach_x86 ${MACHINE})
IF (_mach_x86)
    SET(ARCH_X86 1)
ENDIF (_mach_x86)

STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _mach_x86_64 ${MACHINE})
IF (_mach_x86_64)
    SET(ARCH_X86_64 1)
    SET(LIB_SUFFIX 64)
    #jromang - Hack to avoid boost bug on x64  Ubuntu 8.10 and Fedora 10 (http://www.luxrender.net/mantis/view.php?id=433)
    ADD_DEFINITIONS(-DBOOST_NO_INTRINSIC_INT64_T)
ENDIF (_mach_x86_64)

STRING(REGEX MATCH "(ppc-*)|(powerpc-*)" _mach_ppc ${MACHINE})
IF (_mach_ppc)
    SET(ARCH_PPC 1)
ENDIF (_mach_ppc)
on
Code: Select all
#############################################################################
#############################################################################
### check for the CPU we build for                                        ###
#############################################################################
#############################################################################
MESSAGE(STATUS "Building for target ${CMAKE_SYSTEM_PROCESSOR}")

if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|i686") #add other x86
    SET(ARCH_X86 1)
endif()

if(CMAKE_SYSTEM_PROCESSOR MATCHES “x86_64”) #add other 64
         SET(ARCH_X86_64 1)
    SET(LIB_SUFFIX 64)
    #jromang - Hack to avoid boost bug on x64  Ubuntu 8.10 and Fedora 10   (http://www.luxrender.net/mantis/view.php?id=433)
    ADD_DEFINITIONS(-DBOOST_NO_INTRINSIC_INT64_T)
endif()

if (CMAKE_SYSTEM_PROCESSOR MATCHES “ppc|powerpc”) #test on apple
   SET(ARCH_PPC 1)
endif()
for correct build on Windows.
It need to test.
UPD: fix comments
Last edited by exvion on Tue Oct 20, 2009 5:51 am, edited 1 time in total.
exvion
 
Posts: 84
Joined: Mon May 18, 2009 12:33 pm
Location: Russia, Vologda

Re: Cmake on Windows

Postby jeanphi » Tue Oct 20, 2009 5:37 am

Hi,

Thanks, I'll have a go at it, and include it if it works here.

Jeanphi
jeanphi
Developer
 
Posts: 7943
Joined: Mon Jan 14, 2008 7:21 am


Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 1 guest