[CMake] cpack -G NSIS

Eric Noulard eric.noulard at gmail.com
Tue Jan 10 14:18:34 EST 2012


2012/1/10 Andrea Crotti <andrea.crotti.0 at gmail.com>:
> On 01/10/2012 05:52 PM, Eric Noulard wrote:
>>
>> 2012/1/10 Andrea Crotti<andrea.crotti.0 at gmail.com>:
>>>
>>> Trying to run cpack on Linux (archlinux 64 bit) with a working makensis
>>> environment,
>>
>> Which version of cmake/cpack are you using?
>> If not 2.8.7 could you try it? or even git master?
>> Did you compile it yourself?
>>
>> Are you cross-compiling?
>> If this is the case may be you hit something similar to:
>> http://www.cmake.org/pipermail/cmake/2011-December/048123.html
>>
> It's the 2.8.7, but same problem with the git version:
> [andrea at precision test_cmake]$ /home/andrea/cmake/bin/cpack -G nsis --debug
> CPack: /home/andrea/cmake/Source/CPack/cpack.cxx:230 Enable Debug
> CPack Error: /home/andrea/cmake/Source/CPack/cpack.cxx:397 Cannot initialize
> CPack generator: nsis

This does not seems to fail in the same way?

> (By the way you lack a .gitignore, which for example might contain
> "Bootstrap.cmk")

Why?
Usually when you build CMake you do it out-of-source:

mkdir bstrap
cd btstrap
/path/to/CMake/bootstrap

if you do build in-source you can clean-up using
git clean

> What do you mean cross-compiling?

The compiled (target) executable are not the same type as the one
of the machine (host) you are compiling.
see:
https://en.wikipedia.org/wiki/Cross_compiler
and the way to go with cmake;
http://www.cmake.org/Wiki/CMake_Cross_Compiling

> I'm on linux and the *exe are supposed to work only on Windows,
> so yes in that sense I'm cross-compiling.
> (look like is the same problem of the other thread anyway)

Then may be I'll cc Hendrik because in the end he
solves his problem but I don't know how.

Is your project "public" shainll try to compile it myself?
I am cross-compiling the CERTI project  for Windows
https://savannah.nongnu.org/projects/certi/
pretty much in similar config as yours:

host   = Debian Linux 64bit
target = win32 using i686-w64-mingw32-gcc/g++

You can try to checkout the latest source:
https://savannah.nongnu.org/cvs/?group=certi

then
cd certi
mkdir buildWin32
cd buildWin32
cmake -DCMAKE_TOOLCHAIN_FILE=../scripts/Toolchain-cross-mingw32-linux.cmake ..
make
cpack -G NSIS

this works for me.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list