[CMake] starting cpack and select the generator for CPACK

Eric Noulard eric.noulard at gmail.com
Wed Jul 31 11:19:17 EDT 2013


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