MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014827 | CMake | Development | public | 2014-03-24 07:13 | 2016-06-10 14:31 |
Reporter | Vikas Pachisia | ||||
Assigned To | Kitware Robot | ||||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | AMD64 | OS | Windows | OS Version | Any |
Product Version | CMake 2.8.12.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0014827: Preprocessor definitions for x64 projects are not correct on Windows Platform. | ||||
Description | When trying to make a x64 windows project using CMake it always assigns the platform defines as WIN32 while it should be assigning the platform define as WIN64. | ||||
Steps To Reproduce | 1. Try to make a simple basic x64 project that will create a visual studio solution file (.sln) file. 2. Open the solution file that contains the x64 project. 3. Check the Project Properties for C++ -> Preprocessor -> Preprocessor Definitions 4. You can see WIN32 as the preprocessor defines where as it should be WIN64. | ||||
Additional Information | The following change can fix this for most projects: 1. Open the CMake file: C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake 2. Search for the code: if(MSVC_C_ARCHITECTURE_ID MATCHES 64 OR MSVC_CXX_ARCHITECTURE_ID MATCHES 64) set(CMAKE_CL_64 1) else() set(CMAKE_CL_64 0) endif() if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64) set(CMAKE_CL_64 1) endif() 3. Add the following new code after the end if mentioned above: if(CMAKE_CL_64) set(WIN64 1) else() set(WIN32 1) endif() 4. Search for 'set(_PLATFORM_DEFINES "/DWIN32")' 5. Replace the above line with the following code: if(CMAKE_CL_64) set(_PLATFORM_DEFINES "/DWIN64") else() set(_PLATFORM_DEFINES "/DWIN32") endif() | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://public.kitware.com/Bug/file/5102/Windows-MSVC.cmake | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2014-03-24 07:13 | Vikas Pachisia | New Issue | |||
2014-03-24 07:13 | Vikas Pachisia | File Added: Windows-MSVC.cmake | |||
2014-03-24 08:34 | Brad King | Note Added: 0035479 | |||
2014-03-28 09:13 | Vikas Pachisia | Note Added: 0035553 | |||
2014-03-31 09:20 | Brad King | Note Added: 0035569 | |||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042514 | |||
2016-06-10 14:29 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|