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

Am I misunderstanding something? (conan already ran / target exists) #145

Open
etodanik opened this issue Aug 30, 2023 · 2 comments
Open
Assignees
Labels

Comments

@etodanik
Copy link

I'm using this plugin, and putting this kind of code in my CMakeLists.txt:

find_package(SDL2 REQUIRED CONFIG)
target_link_libraries(${TARGET_NAME} SDL2::SDL2main)
if (TARGET SDL2::SDL2-static)
    target_link_libraries(${TARGET_NAME} SDL2::SDL2-static)
else ()
    target_link_libraries(${TARGET_NAME} SDL2::SDL2)
endif ()

Everything works, but I also get these sort of warnings:

-- Shared link flags (Release):  -Wl,-dead_strip;-Wl,-dead_strip 
-- CMake-Conan: find_package(SDL2) found, 'conan install' already ran
-- Conan: Component target declared 'SDL2::SDL2'
-- Conan: Component target declared 'SDL2::SDL2main'
CMake Warning at cmake-build-debug/conan/SDL2Targets.cmake:25 (message):
  Target name 'SDL2::SDL2-static' already exists.
Call Stack (most recent call first):
  cmake-build-debug/conan/SDL2Config.cmake:16 (include)
  conan_provider.cmake:348 (find_package)
  project/cube/CMakeLists.txt:24 (find_package)

Am I doing something wrong? Or are warnings of the sort expected?

@czoido
Copy link
Contributor

czoido commented Aug 31, 2023

Hi @israelidanny,

Thanks a lot for reporting. I think this is something related to the recipe itself, it appears that the recipe declares an alias and there's a target with that name already. The source for the recipe is here: https://github.com/conan-io/conan-center-index/blob/master/recipes/sdl/all/conanfile.py
I'll have a deeper look at that or if that should be a warning or not in Conan but this is not related with the plugin itself.

@czoido czoido self-assigned this Aug 31, 2023
@czoido
Copy link
Contributor

czoido commented Sep 5, 2023

This is already being discussed in conan-io/conan#14644 (comment) and all those warnings will probably be removed in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants