[CMake] [CMAKE] make package works but ninja package does not

Alfred Sawaya alfred at huji.fr
Wed Apr 25 08:03:42 EDT 2018


The only difference is about the usage of preinstall target. The Ninja
generator does not use it, and it should because it need to build sqlcipher
before packaging it...

the interesting part of vimdiff of cpack --trace :

*        Unix Makefiles                                   |
 Ninja*
  CPack: Install projects                              |  CPack: Install
projects
  ---------------------------------------------- --------|  CPack: - Run
preinstall target for: sqlcipher
  CPack: - Install project: sqlcipher             |  CPack: - Install
project: sqlcipher

Regards,

Le mer. 25 avr. 2018 à 13:03, Alfred Sawaya <alfred at huji.fr> a écrit :

> Hello folks,
>
> I ran into an issue today and I think it is an unexpected behaviour.
>
> I have a CMake project that build an external project (autotools) and pack
> it into a .deb.
> It works when I use the Makefile generator (cmake /my/path) but it does
> not when I use the Ninja generator (cmake -G Ninja /my/path) -> it produces
> an valid but empty package.
>
> I expected that the behaviour would be the same regardless the generator I
> use. Is that correct ?
>
> *Here is the complete CMakeLists.txt : *
>
> project(sqlcipher)
> cmake_minimum_required (VERSION 2.8)
> include(ExternalProject)
>
> ExternalProject_Add(
>     lsqlcipher
>     GIT_REPOSITORY https://github.com/sqlcipher/sqlcipher.git
>     BUILD_IN_SOURCE true
>     CONFIGURE_COMMAND ./configure --enable-tempstore=yes
> "CFLAGS=-DSQLITE_HAS_CODEC"
> )
>
> SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.0.2,libssl-dev")
> SET(CPACK_DEBIAN_PACKAGE_PROVIDES "libqlcipher0, libsqlcipher-dev,
> sqlcipher")
> SET(CPACK_DEBIAN_PACKAGE_REPLACES ${CPACK_DEBIAN_PACKAGE_PROVIDES})
> SET(CPACK_GENERATOR "DEB")
> SET(CPACK_PACKAGE_NAME "my-sqlcipher")
> SET(CPACK_PACKAGE_VERSION "3.20.1")
> SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Me")
> SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Install the last version of
> sqlcipher")
> SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all")
> SET(CPACK_PACKAGE_FILE_NAME
> "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
> INCLUDE(CPack)
>
> *To reproduce : *
>
>    1. Copy the CMakeLists.txt content to a file
>    2. mkdir build
>    3. cd build
>    4. cmake ..
>    5. make package
>    6. dpkg -c *.deb # => there is contents
>    7. rm -rf *
>    8. cmake -G Ninja ..
>    9. ninja package
>    10. dpkg -c *.deb # => it is empty...
>
> Any idea of what I am doing wrong ? Or is it a bug in CMake/CPack ?
>
> Thank you,
>
> Alfred
> --
> Cordialement,
> Alfred Sawaya
>
-- 
Cordialement,
Alfred Sawaya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180425/2d7d8a44/attachment.html>


More information about the CMake mailing list