conan-clion-plugin icon indicating copy to clipboard operation
conan-clion-plugin copied to clipboard

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

Open etodanik opened this issue 2 years ago • 2 comments

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?

etodanik avatar Aug 30 '23 18:08 etodanik

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 avatar Aug 31 '23 07:08 czoido

This is already being discussed in https://github.com/conan-io/conan/pull/14644#issuecomment-1706127124 and all those warnings will probably be removed in the next version.

czoido avatar Sep 05 '23 08:09 czoido