[CMake] starting cpack and select the generator for CPACK

ycollette.nospam at free.fr ycollette.nospam at free.fr
Wed Jul 31 11:23:47 EDT 2013


Thanks, it works fine for the packaging.
And thanks too for the ant link. I think I will switch to the ant exec task.

Best regards,

YC

----- Mail original -----
De: "Eric Noulard" <eric.noulard at gmail.com>
À: "Yann COLLETTE" <ycollette.nospam at free.fr>
Cc: "cmake" <cmake at cmake.org>
Envoyé: Mercredi 31 Juillet 2013 17:19:17
Objet: Re: [CMake] starting cpack and select the generator for CPACK

2013/7/31  <ycollette.nospam at free.fr>:
> hello,
>
> I would like to start cpack using the cmake command.
> For example, to start the test using cmake, I found the following command:
>
> cd ${CMAKE_BINARY_DIR}
> cmake --build . --target test
>
> I think
> cd ${CMAKE_BINARY_DIR}
> cmake --build . --target package
>
> should work, but I don't know how to specify the generator (ZIP or DEB for example).

I guess that in this case you'll have to choose the CPack generator to
be used when
configuring the build tree with CMake initially.

i.e.

cd ${CMAKE_BINARY_DIR}
cmake -D CPACK_GENERATOR="ZIP;DEB" /path/to/source

then
cmake --build . --target package

will build ZIP and DEB.

or...

> The same question applied to ctest: how can I pass some options like '-R Python' using the cmake command.
>
> My constraint is that I must use ant to launch cmake (and the cmake plugin seems to only know the cmake command. Neither ctest nor cpack).

You may teach CMake ant task to learn about cpack and ctest command.
or use the generic "Exec" task:
http://ant.apache.org/manual/Tasks/exec.html


-- 
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org


More information about the CMake mailing list