Search code examples
cmakecpack

do I need the CMake install step when packaging with CPack?


Reading the cmake/cpack documentation, it is stated that CPack will generate an installer which contains everything installed via CMake’s INSTALL command.

However, do I need the cmake --build . --target install in the my following packaging command line sequence ?

 - cmake ..
 - cmake --build .
 - cmake --build . --target install
 - cmake --build . --target package 

Solution

  • Packaging is an alternative to installation.

    If you want create a package, you do not need to execute install target.

    (But installation may be implicitely performed by 'package' target).