jahnf / Projecteur

Linux Desktop Application for the Logitech Spotlight device (and similar devices) - Digital Laser Pointer
MIT License
379 stars 33 forks source link

[BUG] Unable to build 0.8 from tarball - get_target_property() called with non-existent target "source-archive" #98

Closed rombert closed 4 years ago

rombert commented 4 years ago

Description I am trying to build projecteur in the open build service from opensuse - https://build.opensuse.org . This is a quite locked down environment with no network access and a minimal set of dependencies installed.

I have managed to kick off the build, but it now fails at the cmake step

[    5s] + cmake ..
[    5s] -- Setting build type to 'Release' as none was specified.
[    5s] -- The CXX compiler identification is GNU 10.2.1
[    5s] -- Detecting CXX compiler ABI info
[    5s] -- Detecting CXX compiler ABI info - done
[    5s] -- Check for working CXX compiler: /usr/bin/c++ - skipped
[    5s] -- Detecting CXX compile features
[    5s] -- Detecting CXX compile features - done
[    5s] -- Compiling without Qt5::X11Extras.
[    5s] -- Compiling without Qt5::DBus.
[    5s] -- Could NOT find Git (missing: GIT_EXECUTABLE) 
[    5s] -- Version-Info: Git not found. Possible incomplete version information.
[    5s] -- Version-Info: Failure during version retrieval. Possible incomplete version information!
[    5s] -- Version info for 'projecteur': 0.8
[    5s] -- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3") 
[    5s] -- Checking for module 'udev'
[    5s] --   Package 'udev', required by 'virtual:world', not found
[    5s] -- Could NOT find Git (missing: GIT_EXECUTABLE) 
[    5s] -- Cannot add 'source-archive' target, git not found.
[    5s] -- Could not get linux distribution id, defaulting to 'linux'
[    5s] -- Could not get linux version, defaulting to 'unknown'
[    5s] CMake Error at cmake/modules/LinuxPackaging.cmake:179 (get_target_property):
[    5s]   get_target_property() called with non-existent target "source-archive".
[    5s] Call Stack (most recent call first):
[    5s]   cmake/modules/LinuxPackaging.cmake:165 (_makepkg_packaging)
[    5s]   CMakeLists.txt:218 (add_dist_package_target)

I am not sure what the problem is here, hence this issue. Note that I am interesting in building the binaries and configs only, as I will then assemble the RPM. If I can disable parts of the build that generate

To Reproduce

Build on OBS:

Expected behavior

The build succeeds.

Desktop/Linux Environment (please complete the following information):

Not applicable

Screenshots

Not applicable.

jahnf commented 4 years ago

Thanks for reporting this. Well in this case you would need to skip the call to add_source_archive_target(projecteur) and add_dist_package_target(... - probably with a patch file for the main CMakeLists.txt in your case. I can include a CMake option to disable these two steps if set (e.g. cmake .. -DPACKAGE_TARGETS=OFF or similar), but that will only affect new versions and won't help you with 0.8 of course.

With your patch file you could wrap the mentioned calls in an if, e.g.

if(FALSE)
  add_source_archive_target(projecteur)
  add_dist_package_target(...
endif()
rombert commented 4 years ago

Thanks for the quick reply @jahnf . I'll add the change you suggested as a local patch and see if that unblocks the build.

jahnf commented 4 years ago

Alright, let me know if it works. You can keep this issue open even if the build succeeds, I'll close when a build option to disable the generation of these package targets has been added.

rombert commented 4 years ago

With that change, I was able to start compilation. Compilation failed due to a GCC complaining about an unused parameter

[   16s] /home/abuild/rpmbuild/BUILD/projecteur-v0.8/src/linuxdesktop.cc: In member function 'QPixmap LinuxDesktop::grabScreenWayland(QScreen*) const':
[   16s] /home/abuild/rpmbuild/BUILD/projecteur-v0.8/src/linuxdesktop.cc:125:50: error: unused parameter 'screen' [-Werror=unused-parameter]
[   16s]   125 | QPixmap LinuxDesktop::grabScreenWayland(QScreen* screen) const
[   16s]       |                                         ~~~~~~~~~^~~~~~
[   16s] cc1plus: all warnings being treated as errors

After appending -Wno-unused-parameter to CXXFLAGS compilation succeeds. Now I just have to figure out what to install where, but it should be easy given that you already create packages.

Thanks!

jahnf commented 4 years ago

Current develop and future versions now on support disabling of creating the package build targets in CMake, example:

cmake .. -DPACKAGE_TARGETS=OFF