MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013929 | CMake | CPack | public | 2013-02-17 17:25 | 2016-06-10 14:31 |
Reporter | Nathan Osman | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | Linux | OS | Ubuntu | OS Version | 12.10 |
Product Version | CMake 2.8.10 | ||||
Target Version | Fixed in Version | ||||
Summary | 0013929: __cpack_system_name incorrectly set when compiling with Mingw-w64 | ||||
Description | I have a CMake/CPack project that I am cross-compiling for 32 and 64-bit Windows. CPack generates an NSIS installer for both architectures but incorrectly detects a 32-bit compiler in both cases. After looking through the source code for Modules/CPack.cmake, I came across the following: if(${__cpack_system_name} MATCHES Windows) if(CMAKE_CL_64) set(__cpack_system_name win64) ... It appears that CPack is only checking for the 64-bit compiler that ships with MSVC++ and not for Mingw-w64. | ||||
Steps To Reproduce | Assuming you have the Mingw-w64 compiler installed, the following steps will reproduce the problem: 1. Create a very simple project that consists of the following files: test.cpp: #include <iostream> int main(int argc, char ** argv) { std::cout << "Hello world!" << std::endl; return 0; } CMakeLists.txt: cmake_minimum_required(VERSION 2.8) project(test) add_executable(test test.cpp) install(TARGETS test RUNTIME DESTINATION bin) include(CPack) 2. Create a CMake toolchain file like so (toolchain.cmake in the same directory): set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) (You may need to adjust the value of "CMAKE_FIND_ROOT_PATH".) 3. Build the package: mkdir build ; cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake .. make package 4. You should end up with an incorrectly named installer titled: test-0.1.1-win32.exe | ||||
Additional Information | |||||
Tags | cross compile | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-02-17 17:25 | Nathan Osman | New Issue | |||
2013-02-17 17:26 | Nathan Osman | Tag Attached: cross compile | |||
2013-02-17 17:27 | Nathan Osman | Note Added: 0032320 | |||
2016-06-10 14:28 | Kitware Robot | Note Added: 0042226 | |||
2016-06-10 14:28 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:28 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|