2014-10-14 9:24 GMT+02:00 Jörg Kreuzberger <[email protected]>:

> Ok, found it: i must set CPACK_SOURCE_TZ to off to avoid the source to be
> packaged as tz.
> its a little bit different as for the binary package, but ok.
>

This is a another way to select CPack generator but you can always specify
the list explicitely
in your CMakeLists.txt **before** include(CPack).

You may have some "logic" depending on the target platform e.g;

if(WIN32)
    set(CPACK_SOURCE_GENERATOR "ZIP")
    set(CPACK_GENERATOR "ZIP")

    # Add NSIS generator iff makensis is found on the system
    find_program(MAKENSIS_EXECUTABLE
                 NAMES makensis
                 DOC "The NSIS package maker command")
    if (MAKENSIS_EXECUTABLE)
      list(APPEND CPACK_GENERATOR "NSIS")
    endif(MAKENSIS_EXECUTABLE)
else(WIN32)
    set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
    if(APPLE)
      set(CPACK_GENERATOR "TGZ;PackageMaker")
    else(APPLE)
      set(CPACK_GENERATOR "TGZ;RPM;DEB")
    endif(APPLE)
endif(WIN32)

include(CPack)


With this if you are in the build directory
make package (or in a generator independent way "cmake --build . --target
package")
or
make package_source

will build the list of specified CPack generators packages.

However you can always override that by doing (in the build dir as well):
cpack -G TGZ

which will only build the binary TGZ whatever was specified in the
CMakeLists.txt.

for the source package this is done using the CPackSourceConfig.cmake file:

cpack -G TGZ --config CPackSourceConfig.cmake

I hope this helps in understanding the way CPack works.


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

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to