mercredi 22 juin 2016

CPack empty CPACK_PACKAGE_DIRECTORY

I am really struggling to get CPack to act the way I am imagining it should. I have a small example setup below that I have been trying to get work before applying it to a much larger project. Essentially I am trying to use fixup_bundle to collect all dependencies and copy them to the packaging directory to be combined into an installer (and zip). main.cpp: int main(unsigned int argc, const char* argv[]) { return 0; } CMakeLists.txt: cmake_minimum_required(VERSION 3.1.0) find_package(Qt5 REQUIRED COMPONENTS Core Gui Multimedia Widgets AxContainer OpenGL) add_executable(TEST main.cpp) target_link_libraries(TEST Qt5::AxContainer Qt5::Core Qt5::Multimedia Qt5::Gui Qt5::Widgets Qt5::OpenGL ) install( TARGETS TEST RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT Runtime ) install(CODE "MESSAGE("CPACK_PACKAGING_PREFIX=${CPACK_PACKAGING_PREFIX}")") install(CODE "MESSAGE("CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")") install(CODE "MESSAGE("CPACK_INSTALL_PREFIX=${CPACK_INSTALL_PREFIX}")") install(CODE "MESSAGE("CPACK_INSTALL_DIRECTORY=${CPACK_INSTALL_DIRECTORY}")") install(CODE "MESSAGE("CPACK_PACKAGE_INSTALL_DIRECTORY=${CPACK_PACKAGE_INSTALL_DIRECTORY}")") install(CODE "MESSAGE("CPACK_PACKAGING_INSTALL_PREFIX=${CPACK_PACKAGING_INSTALL_PREFIX}")") install(CODE "MESSAGE("CPACK_PACKAGE_DIRECTORY=${CPACK_PACKAGE_DIRECTORY}")") install(CODE "MESSAGE("CPACK_TOPLEVEL_DIRECTORY=${CPACK_TOPLEVEL_DIRECTORY}")") install(CODE "MESSAGE("CPACK_TEMPORARY_DIRECTORY=${CPACK_TEMPORARY_DIRECTORY}")") install(CODE "MESSAGE("CPACK_OUTPUT_FILE_NAME=${CPACK_OUTPUT_FILE_NAME}")") install(CODE "MESSAGE("CPACK_OUTPUT_FILE_PATH=${CPACK_OUTPUT_FILE_PATH}")") install(CODE "MESSAGE("CPACK_TEMPORARY_PACKAGE_FILE_NAME=${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")") install(CODE "MESSAGE("CPACK_NATIVE_INSTALL_DIRECTORY=${CPACK_NATIVE_INSTALL_DIRECTORY}")") install(CODE "MESSAGE("CPACK_TEMPORARY_INSTALL_DIRECTORY=${CPACK_TEMPORARY_INSTALL_DIRECTORY}")") install(CODE " include(BundleUtilities) fixup_bundle("${CPACK_PACKAGE_DIRECTORY}/TEST${CMAKE_EXECUTABLE_SUFFIX}" "" "${DIRS}") " COMPONENT Runtime) set(CPACK_GENERATOR "ZIP" "NSIS") include(CPack) And the output is always a bunch of empty variables: CPACK_PACKAGING_PREFIX= CMAKE_INSTALL_PREFIX=C:/Program Files (x86)/Project CPACK_INSTALL_PREFIX= CPACK_INSTALL_DIRECTORY= CPACK_PACKAGE_INSTALL_DIRECTORY= CPACK_PACKAGING_INSTALL_PREFIX= CPACK_PACKAGE_DIRECTORY= CPACK_TOPLEVEL_DIRECTORY= CPACK_TEMPORARY_DIRECTORY= CPACK_OUTPUT_FILE_NAME= CPACK_OUTPUT_FILE_PATH= CPACK_TEMPORARY_PACKAGE_FILE_NAME= CPACK_NATIVE_INSTALL_DIRECTORY= CPACK_TEMPORARY_INSTALL_DIRECTORY= CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/BundleUtilities.cmake:861 (message): error: fixup_bundle: not a valid bundle, app: /TEST.exe Obviously it won't find the right executable. I am expecting CPACK_PACKAGE_DIRECTORY to be something like: ${CMAKE_BINARY_DIR}/_CPack_Packages/${CPACK_SYSTEM_NAME}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}

Aucun commentaire:

Enregistrer un commentaire