texus / TGUI

Cross-platform modern c++ GUI

Home Page:https://tgui.eu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMake fails to install pkg-config files

nikoof opened this issue · comments

When passing -D TGUI_INSTALL_PKGCONFIG_FILES=1 to cmake, it errors out with

CMake Error at src/CMakeLists.txt:483 (install):
  install FILES given no DESTINATION!

If I understand this correctly, $TGUI_PKGCONFIG_INSTALL_PREFIX should be set automatically in the top-level CMakeLists.txt. Either way, if I set it explicitly with -D TGUI_PKGCONFIG_INSTALL_PREFIX=pkgconfig, the cmake generation succeeds, but the installation fails with

CMake Error at src/cmake_install.cmake:108 (file):
  file INSTALL cannot find "/tmp/TGUI/build/src/pkgconfig/tgui.pc": No such
  file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)

I think this is caused by the following lines in src/CMakeLists.txt:

if (TGUI_INSTALL_PKGCONFIG_FILES)
    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/tgui.pc" DESTINATION "${TGUI_PKGCONFIG_INSTALL_PREFIX}")
endif()

Where $CMAKE_CURRENT_BINARY_DIR points to src instead of the root build directory (where pkgconfig/tgui.pc ends up). I guess the second issue can be fixed by changing this path.

I am not at all good with cmake, so I'm not really sure how to approach the first issue about $TGUI_PKGCONFIG_INSTALL_PREFIX not being set at all.

Thanks for letting me know with the details about what is failing.
I apparently messed up the pkgconfig installation in a recent change where I moved around some install lines in the cmake script.
It should work again now.

Can confirm that it is working! 👍