diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-03-30 18:49:56 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-03-30 18:49:56 (GMT) |
commit | 5a2668b326471874ca69357af831cdcf1575c621 (patch) | |
tree | 92f40c9de267766f0533df44212ec2df6415aa47 /Modules | |
parent | 08b14163ee2cc9cced08d80b2c81b29c83072229 (diff) | |
download | CMake-5a2668b326471874ca69357af831cdcf1575c621.zip CMake-5a2668b326471874ca69357af831cdcf1575c621.tar.gz CMake-5a2668b326471874ca69357af831cdcf1575c621.tar.bz2 |
ENH: add support for win64 for visual studio 2005 ide and nmake, also fix warnings produced by building for win64
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Platform/Windows-cl.cmake | 33 | ||||
-rw-r--r-- | Modules/Platform/Windows-cl.cmake.in | 1 |
2 files changed, 33 insertions, 1 deletions
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 39fea0d..c004b2f 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -140,9 +140,36 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles") MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp3") + MESSAGE(STATUS "Check for CL win64") + EXEC_PROGRAM(${CMAKE_C_COMPILER} ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp3 + ARGS /nologo /link /machine:i386 + \"${testForFreeVCFile}\" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT + RETURN_VALUE CMAKE_COMPILER_RETURN + ) + # if there was an error assume it is a 64bit system + IF(CMAKE_COMPILER_RETURN) + FILE(APPEND + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + "Determining if this is a 64 bit system passed:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + MESSAGE(STATUS "Check if this is a 64 bit system - yes") + SET(CMAKE_CL_64 1) + ELSE(CMAKE_COMPILER_RETURN) + FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + "Determining if this is a 32 bit system passed:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + MESSAGE(STATUS "Check if this is 32 bit system - yes") + SET(CMAKE_CL_64 0) + ENDIF(CMAKE_COMPILER_RETURN) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) ENDIF(CMAKE_GENERATOR MATCHES "NMake Makefiles") +IF(CMAKE_FORCE_WIN64) + SET(CMAKE_CL_64 1) +ENDIF(CMAKE_FORCE_WIN64) + # default to Debug builds IF(CMAKE_COMPILER_2005) @@ -213,7 +240,11 @@ MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386 /INCREMENTAL:YES") +IF(CMAKE_CL_64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:x64 /INCREMENTAL:YES") +ELSE(CMAKE_CL_64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386 /INCREMENTAL:YES") +ENDIF(CMAKE_CL_64) IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept") SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept") diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in index 7c42a54..2e01327 100644 --- a/Modules/Platform/Windows-cl.cmake.in +++ b/Modules/Platform/Windows-cl.cmake.in @@ -2,3 +2,4 @@ SET(CMAKE_VC_COMPILER_TESTS_RUN 1) SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@) SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) +SET(CMAKE_CL_64 @CMAKE_CL_64@) |