tags:

views:

11

answers:

1

Here is the setup I tried using CMake 2.8.2 to reproduce the problem:

/test.sh:

/CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)

SET(CPACK_PACKAGE_NAME test)
SET(CPACK_PACKAGE_VERSION 1.0)

LIST(APPEND CPACK_GENERATOR RPM)

SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "test.sh")

INCLUDE(CPack)

then:

mkdir build && cd build && cmake .. && make package

Results:

CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE does not exists - ignoring

How to make the build system aware of my file test.sh ?

A: 

I needed to use:

SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.sh")

to make it work.

This variable needs to be absolute to work.

ybart