5

I have a cmake project that uses cpack to produce both a zip file and a debian package and I would like to be able to install different files for the two version of the packages.

To be more specific, here is a sample CMake file that produces both a zip and a debian package:

cmake_minimum_required(VERSION 3.5)
project(test_packaging)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SOURCE_FILES main.cpp)
add_executable(test_packaging ${SOURCE_FILES})

install(FILES test.txt DESTINATION auxilliary/)

set(CPACK_GENERATOR "ZIP;DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Ford Prefect")

include(CPack)

What I would like to do is to install two different version of the test.txt file in the two different packages? Something like

if(packaging zip)
  install(FILES test_zip.txt DESTINATION auxilliary/)
elseif(packaging deb)
  install(FILES test_deb.txt DESTINATION auxilliary/)
endif(expression)
Jacopo
  • 1,031
  • 2
  • 12
  • 25

0 Answers0