{"action":"created","issue":{"url":"https://api.github.com/repos/conan-io/conan/issues/2076","repository_url":"https://api.github.com/repos/conan-io/conan","labels_url":"https://api.github.com/repos/conan-io/conan/issues/2076/labels{/name}","comments_url":"https://api.github.com/repos/conan-io/conan/issues/2076/comments","events_url":"https://api.github.com/repos/conan-io/conan/issues/2076/events","html_url":"https://github.com/conan-io/conan/issues/2076","id":276623294,"number":2076,"title":"Use CONAN_PKG without a specific dependecy does not work anymore since 0.29","user":{"login":"JohnboyJovi","id":13200276,"avatar_url":"https://avatars2.githubusercontent.com/u/13200276?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnboyJovi","html_url":"https://github.com/JohnboyJovi","followers_url":"https://api.github.com/users/JohnboyJovi/followers","following_url":"https://api.github.com/users/JohnboyJovi/following{/other_user}","gists_url":"https://api.github.com/users/JohnboyJovi/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnboyJovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnboyJovi/subscriptions","organizations_url":"https://api.github.com/users/JohnboyJovi/orgs","repos_url":"https://api.github.com/users/JohnboyJovi/repos","events_url":"https://api.github.com/users/JohnboyJovi/events{/privacy}","received_events_url":"https://api.github.com/users/JohnboyJovi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-24T13:53:50Z","updated_at":"2017-11-24T16:47:12Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nFor mock testing I need to be able to take one of my conan packages and link against it but not one of its dependend libraries in Visual Studio.\r\nThe package here being ``gl`` which I want to depend on without adding a dependency to ``glew`` which is inside of it.\r\n\r\nSo far we did that as:\r\n```\r\nadd_library(gl_without_glew INTERFACE IMPORTED)\r\nget_target_property(gl_link_libraries CONAN_PKG ::gl INTERFACE_LINK_LIBRARIES)\r\nlist(REMOVE_ITEM gl_link_libraries CONAN_PKG ::glew)\r\nset_property(TARGET gl_without_glew PROPERTY INTERFACE_LINK_LIBRARIES ${gl_link_libraries})\r\n...\r\n```\r\n\r\nCurrently this does not work anymore, since the gl_link_biraries are now resolved to:\r\n``$<$<CONFIG:Release>:CONAN_LIB::gl_glrelease;>;$<$<CONFIG:RelWithDebInfo>:CONAN_LIB::gl_glrelease;>;$<$<CONFIG:MinSizeRel>:CONAN_LIB::gl_glrelease;>;$<$<CONFIG:Debug>:CONAN_LIB::gl_gldebug;>;CONAN_PKG::glew`` from which the glew is removed. However, the glew dependency is still also hidden within the ``CONAN_LIB`` thingy\r\n\r\nAt version 0.28 the above resolved to:\r\n``$<$<CONFIG:Release>:C:/Users/jw210150/.conan/data/gl/1.0.0/RWTH-VR/thirdparty/package/d14e4c5c45ecf77bc3e21f3f778081080a637c29/lib/gl.lib;>;$<$<CONFIG:RelWithDebInfo>:C:/Users/jw210150/.conan/data/gl/1.0.0/RWTH-VR/thirdparty/package/d14e4c5c45ecf77bc3e21f3f778081080a637c29/lib/gl.lib;>;$<$<CONFIG:MinSizeRel>:C:/Users/jw210150/.conan/data/gl/1.0.0/RWTH-VR/thirdparty/package/d14e4c5c45ecf77bc3e21f3f778081080a637c29/lib/gl.lib;>;$<$<CONFIG:Debug>:C:/Users/jw210150/.conan/data/gl/1.0.0/RWTH-VR/thirdparty/package/cb2ad63ea6c3a4f3a2b914e329abe3103734356d/lib/gl.lib;>;CONAN_PKG::glew`` so glew could sucessfully be removed.\r\n\r\nDo you have any ideas how I can overcome this, the problem seems to come from using now ``conan_package_library_targets`` in conanbuildinfo_multi.cmake instead of before ``conan_find_libraries_abs_path``"},"comment":{"url":"https://api.github.com/repos/conan-io/conan/issues/comments/346867359","html_url":"https://github.com/conan-io/conan/issues/2076#issuecomment-346867359","issue_url":"https://api.github.com/repos/conan-io/conan/issues/2076","id":346867359,"user":{"login":"JohnboyJovi","id":13200276,"avatar_url":"https://avatars2.githubusercontent.com/u/13200276?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnboyJovi","html_url":"https://github.com/JohnboyJovi","followers_url":"https://api.github.com/users/JohnboyJovi/followers","following_url":"https://api.github.com/users/JohnboyJovi/following{/other_user}","gists_url":"https://api.github.com/users/JohnboyJovi/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnboyJovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnboyJovi/subscriptions","organizations_url":"https://api.github.com/users/JohnboyJovi/orgs","repos_url":"https://api.github.com/users/JohnboyJovi/repos","events_url":"https://api.github.com/users/JohnboyJovi/events{/privacy}","received_events_url":"https://api.github.com/users/JohnboyJovi/received_events","type":"User","site_admin":false},"created_at":"2017-11-24T16:47:12Z","updated_at":"2017-11-24T16:47:12Z","author_association":"NONE","body":"Yes, ``gl`` is a conan package (a c++11 OpenGL wrapper) which depends on the conan package ``glew``\r\nIn the tests we want to mock glew in some of the tests (but not necessarily all). This is why I want to create this extra target, which is exactly the same as CONAN_PKG::gl except for the glew dependency. Is that clearer? Sorry, this might sound a bit confusing.\r\n\r\n``CONAN_LIB::gl_release`` does not exist, however ``CONAN_LIB::gl_glrelease`` does. But its only INTERFACE_LINK_LIBRARIES is CONAN_PKG::glew. So when I use this to create my new target, it actually does not link against ``gl`` anymore, so that does not work. \r\n\r\nJust to make it clearer the complete code I used for this target before is:\r\n\r\n```cmake\r\n#add a gl target without glew dependency for mock testing\r\nadd_library(gl_without_glew INTERFACE IMPORTED)\r\nget_target_property(gl_link_libraries CONAN_PKG::gl INTERFACE_LINK_LIBRARIES)\r\nlist(REMOVE_ITEM gl_link_libraries CONAN_PKG::glew)\r\nset_property(TARGET gl_without_glew PROPERTY INTERFACE_LINK_LIBRARIES ${gl_link_libraries})\r\nget_target_property(gl_include_dir CONAN_PKG::gl  INTERFACE_INCLUDE_DIRECTORIES)\r\nset_property(TARGET gl_without_glew PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${gl_include_dir})\r\nget_target_property(gl_compile_definitions CONAN_PKG::gl  INTERFACE_COMPILE_DEFINITIONS)\r\nset_property(TARGET gl_without_glew PROPERTY INTERFACE_COMPILE_DEFINITIONS ${gl_compile_definitions})\r\nget_target_property(gl_compile_options CONAN_PKG::gl  INTERFACE_COMPILE_OPTIONS)\r\nset_property(TARGET gl_without_glew PROPERTY INTERFACE_COMPILE_OPTIONS ${gl_compile_options})\r\n```\r\n\r\n``gl_without_glew`` is then used within target_link_libraries for the mocked tests."}}
{"actor":{"display_login":"JohnboyJovi"}}