[CMake] cpack -G NSIS

Eric Noulard eric.noulard at gmail.com
Wed Jan 18 13:29:30 EST 2012


2012/1/18 Andrea Crotti <andrea.crotti.0 at gmail.com>:
> Thanks for the feedback,
> however I tried again with another cmake file, which should actually do
> something.

May be you could zip up the sample project sources, this would be easier
and safer for me if I want to be able to reproduce your issue.


> What I would like to do is to:
> - get the project name and a list of packages (just directories) to install
> - install them somewhere (now the destination is not set correctly).
>
> Should this work in general?
>
> cmake_minimum_required(VERSION 2.6)
> #TODO: should take from the python environment
>
> # setting variables from some known build generated files
> # probably we can also pass options directly to CMake
> file(STRINGS project_name.txt project_name)
> file(STRINGS package_list.txt packages)
>
> project(${project_name})
>
> # include can be used to add more configurations??
>
> # # install all the given automatically
> install(
>  DIRECTORY ${packages}
>  DESTINATION test_ddest
>  )
>
> #TODO: how do I get the correct destination for windows?
>
> # now the packages variable should contain something
>
> # this include all the necessary
> include(CPack)
>
> But I still get the same error using NSIS (works with TGZ):
>
> CPack: /build/src/cmake-2.8.7/Source/CPack/cpack.cxx:211 Enable Debug
> /build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:1162 Looking for
> CMAKE_ROOT: /usr/share/cmake-2.8
> /build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:941
> cmCPackNSISGenerator::SetOption(CMAKE_ROOT, /usr/share/cmake-2.8)
> /build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:941
> cmCPackNSISGenerator::SetOption(CPACK_GENERATOR, NSIS)
> /build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:1145 Warning,
> GetOption return NULL for: CPACK_PROJECT_CONFIG_FILE
> /build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:1145 Warning,
> GetOption return NULL for: CPACK_INCLUDE_TOPLEVEL_DIRECTORY
> /build/src/cmake-2.8.7/Source/CPack/cmCPackNSISGenerator.cxx:355
> cmCPackNSISGenerator::Initialize()
> /build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:1145 Warning,
> GetOption return NULL for: CPACK_TOPLEVEL_DIRECTORY
>
> terminate called after throwing an instance of 'std::logic_error'
>  what():  basic_string::_S_construct null not valid
> aborted



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


More information about the CMake mailing list