2007/4/13, Mathieu Malaterre <[EMAIL PROTECTED]>:
Hello,I have the following custom target: ADD_CUSTOM_TARGET(data_tgz COMMAND cpack -G TGZ --config CPackConfig.cmake COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.tar.gz ${CMAKE_BINARY_DIR}/data.tar.gz ) Basically a deb package expect a file named 'data.tar.gz' to contains all the libs/bin in it. For some reason CPACK_PACKAGE_FILE_NAME is being expanded as using value from CPackSourceConfig.cmake instead of CPackConfig.cmake.
CPACK_PACKAGE_FILE_NAME is built when you INCLUDE(CPack) (unless you set the value yourself before the INCLUDE) see: /usr/share/cmake-2.4/Modules/CPack.cmake The var name is shared for SOURCE and BINARY package there is a CPACK_SOURCE_PACKAGE_FILE_NAME but no CPACK_BINARY_PACKAGE_FILE_NAME :((( You may get the "real" binary package file name if you INCLUDE(CPackConfig.cmake) just before your ADD_CUSTOM_COMMAND definition. this will set the CPACK_PACKAGE_FILE_NAME to the expected value.
How was I suposed to write this custom target instead ?
I really don't know and my proposition may break the rest of your CMakeLists.txt if it expects CPACK_PACKAGE_FILE_NAME to be the SOURCE package filename. -- Erk _______________________________________________ CMake mailing list [EMAIL PROTECTED] http://www.cmake.org/mailman/listinfo/cmake
