Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target qrcodegencpp::qrcodegencpp does not seem to work #19

Closed
tytan652 opened this issue Apr 21, 2023 · 7 comments · Fixed by #20
Closed

Target qrcodegencpp::qrcodegencpp does not seem to work #19

tytan652 opened this issue Apr 21, 2023 · 7 comments · Fixed by #20
Assignees
Labels
bug Something isn't working

Comments

@tytan652
Copy link

tytan652 commented Apr 21, 2023

Problem details

Continuation of what said in obsproject/obs-deps#182.

The target qrcodegencpp::qrcodegencpp does not seem to work unlike qrcodegencpp that does work.

Steps to reproduce

  1. Install qrcodegencpp with this CMake "patch"
  2. Apply the patch https://src.fedoraproject.org/rpms/obs-studio/blob/rawhide/f/obs-studio-websocket-use-system-qrcodegencpp.patch to a clone of obs-studio repo
  3. Replace qrcodegencpp by qrcodegencpp::qrcodegencpp in the target_link_libraries() of obs-websocket legacy.cmake file (we are progressively rewriting our CMake per OS/Platform so it might be weird for you)
  4. The project will error while configuring

Expected behavior

No configuration error, qrcodegencpp::qrcodegencpp must have worked.

Actual behavior

The target qrcodegencpp::qrcodegencpp is not found.

Project version

1.8.0

OS name and version

Arch Linux (with qrcodegen-cmake AUR package)

C/C++ compiler

GCC

Compiler version

12.2.1

CMake version

3.26.3

Logs

-- Configuring done (2.7s)
CMake Error at plugins/obs-websocket/cmake/legacy.cmake:131 (target_link_libraries):
  Target "obs-websocket" links to:

    qrcodegencpp::qrcodegencpp

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/Modules/ObsHelpers.cmake:519 (include)
  plugins/obs-websocket/CMakeLists.txt:3 (legacy_check)


-- Generating done (0.1s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
*** Failure: Exit code 1 ***
@tytan652 tytan652 added the bug Something isn't working label Apr 21, 2023
@xvitaly
Copy link
Member

xvitaly commented Apr 21, 2023

Can you post generated qrcodegen-cpp-targets*.cmake files?

@tytan652
Copy link
Author

#----------------------------------------------------------------
# Generated CMake target import file for configuration "Release".
#----------------------------------------------------------------

# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)

# Import target "qrcodegencpp::qrcodegencpp" for configuration "Release"
set_property(TARGET qrcodegencpp::qrcodegencpp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(qrcodegencpp::qrcodegencpp PROPERTIES
  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libqrcodegencpp.so.1.8.0"
  IMPORTED_SONAME_RELEASE "libqrcodegencpp.so.1"
  )

list(APPEND _cmake_import_check_targets qrcodegencpp::qrcodegencpp )
list(APPEND _cmake_import_check_files_for_qrcodegencpp::qrcodegencpp "${_IMPORT_PREFIX}/lib/libqrcodegencpp.so.1.8.0" )

# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

@xvitaly
Copy link
Member

xvitaly commented Apr 21, 2023

qrcodegencpp::qrcodegencpp target exists. It's very strange.

@xvitaly
Copy link
Member

xvitaly commented Apr 22, 2023

I was able to reproduce.

@leha-bot
Copy link
Contributor

Hello, @tytan652 , may you check a possible fix in #20, please?

xvitaly added a commit that referenced this issue Apr 22, 2023
CMake install(): Fix namespaced targets detection. (#19)
@tytan652
Copy link
Author

The target qrcodegencpp::qrcodegencpp now works with master.

@xvitaly
Copy link
Member

xvitaly commented Apr 22, 2023

The target qrcodegencpp::qrcodegencpp now works with master.

Great. Thanks for the report and testing. Tagged as v1.8.0-cmake2.

@leha-bot leha-bot self-assigned this Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants