Ultimaker / cura-build-environment

CMake project to build dependencies for Cura
GNU Affero General Public License v3.0
24 stars 55 forks source link

libSavitar fails because DESTDIR environmental var is not set #81

Open jellespijker opened 4 years ago

jellespijker commented 4 years ago

Installing libSavitor fails on Arch based distro, because the environmental variable DESTDIR is used in cmake_install.cmake, which is not set.

Ghostkeeper commented 4 years ago

Interesting. I think this is maybe the same reason as why libSavitar and libArcus want to install to /usr/lib regardless of what the install path is. I haven't been able to find out what is causing that. There is nothing really special about our CMake in that regard. The mentioned cmake_install.cmake is not in our sources.

jellespijker commented 4 years ago

The cmake_install.cmake is generated by the install instructions provide in CMakeLists.txt (see code below) of libSavitar. So maybe it is a libSavitar bug? But the code exempt seems okay by me.

install(TARGETS Savitar
    EXPORT Savitar-targets
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Savitar
)

install(EXPORT Savitar-targets
    DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Savitar
)
Ghostkeeper commented 4 years ago

We're not calling CPACK_SET_DESTDIR as far as I can see, so it shouldn't be using DESTDIR at all :confused:

jellespijker commented 4 years ago

@Ghostkeeper Could you reproduce the issue? Because I can't anymore. I think it happend on my side because I might have forgotten to set the PKG_CONFIG_PATH

Ghostkeeper commented 4 years ago

I don't think I have the same problem as you. However I still have the problem that if I do make install it asks me for admin permissions to create a symlink in /usr/lib even though I've changed the CMAKE_INSTALL_PREFIX to ~/inst, which I think is related to your issue. That happens only with Cura's 3 extra libraries (libSavitar, libArcus and libCharon).

jellespijker commented 4 years ago

Yeah that happend with me as well and I agree that that is unrelated. Could it be that using the include(GNUInstallDirs) (https://cmake.org/cmake/help/v3.17/module/GNUInstallDirs.html) sets the CMAKE_INSTALL_PREFIX again to the system paths. In effect overriding the previous given value.