{"action":"created","issue":{"url":"https://api.github.com/repos/conan-io/conan/issues/400","repository_url":"https://api.github.com/repos/conan-io/conan","labels_url":"https://api.github.com/repos/conan-io/conan/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/conan-io/conan/issues/400/comments","events_url":"https://api.github.com/repos/conan-io/conan/issues/400/events","html_url":"https://github.com/conan-io/conan/issues/400","id":169241898,"number":400,"title":"Generator for Conan","user":{"login":"colinbrownec","id":2192997,"avatar_url":"https://avatars.githubusercontent.com/u/2192997?v=3","gravatar_id":"","url":"https://api.github.com/users/colinbrownec","html_url":"https://github.com/colinbrownec","followers_url":"https://api.github.com/users/colinbrownec/followers","following_url":"https://api.github.com/users/colinbrownec/following{/other_user}","gists_url":"https://api.github.com/users/colinbrownec/gists{/gist_id}","starred_url":"https://api.github.com/users/colinbrownec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinbrownec/subscriptions","organizations_url":"https://api.github.com/users/colinbrownec/orgs","repos_url":"https://api.github.com/users/colinbrownec/repos","events_url":"https://api.github.com/users/colinbrownec/events{/privacy}","received_events_url":"https://api.github.com/users/colinbrownec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-03T21:45:04Z","updated_at":"2016-08-04T21:27:48Z","closed_at":null,"body":"I am trying to set up my workflow to use a combination of CMake and Conan for dependency management. This is working fantastically except that my projects now requires Conan to be built.\r\n\r\nThis is fine, except that I'm not sure how to have Conan build a package that uses Conan.\r\n\r\nIn my project's `build` function,\r\n``` python\r\ncmake = CMake(self.settings)\r\nself.run('mkdir build')\r\nself.run('cd build && conan install ..')\r\nself.run('cd build && cmake %s ../project' % cmake.command_line)\r\nself.run('cd build && cmake --build . --target install %s' % cmake.build_config)\r\n```\r\n\r\nThe `conan install ..` will drop any options the parent project has, dropping back to the defaults in `conan.conf`.\r\n\r\nIs there a Conan generator similar to the CMake generator? \r\n\r\nIf not I think a generator sounds appropriate and would be really simple to create and could try it myself.\r\n\r\nMy suggested solution would be something like,\r\n``` python\r\ncmake = CMake(self.settings)\r\nconan = Conan(self.settings)\r\nself.run('mkdir build')\r\nself.run('cd build && conan install .. %s' conan.command_line)\r\nself.run('cd build && cmake %s ../project' % cmake.command_line)\r\nself.run('cd build && cmake --build . --target install %s' % cmake.build_config)\r\n```"},"comment":{"url":"https://api.github.com/repos/conan-io/conan/issues/comments/237688938","html_url":"https://github.com/conan-io/conan/issues/400#issuecomment-237688938","issue_url":"https://api.github.com/repos/conan-io/conan/issues/400","id":237688938,"user":{"login":"colinbrownec","id":2192997,"avatar_url":"https://avatars.githubusercontent.com/u/2192997?v=3","gravatar_id":"","url":"https://api.github.com/users/colinbrownec","html_url":"https://github.com/colinbrownec","followers_url":"https://api.github.com/users/colinbrownec/followers","following_url":"https://api.github.com/users/colinbrownec/following{/other_user}","gists_url":"https://api.github.com/users/colinbrownec/gists{/gist_id}","starred_url":"https://api.github.com/users/colinbrownec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinbrownec/subscriptions","organizations_url":"https://api.github.com/users/colinbrownec/orgs","repos_url":"https://api.github.com/users/colinbrownec/repos","events_url":"https://api.github.com/users/colinbrownec/events{/privacy}","received_events_url":"https://api.github.com/users/colinbrownec/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T21:27:48Z","updated_at":"2016-08-04T21:27:48Z","body":"So here is my actual problem (this has turned into more of a question than an issue...)\r\n\r\nI see that `conan install` is not neccassary, and a `conanbuildinfo.cmake` is generated. My problem is I guess I don't know how to reference it.\r\n\r\nMy `source()` is a simple `git clone` so my conan build folder looks like\r\n```\r\n64e793d55116d7ff6a1ba115dd066987bceaddc0\r\n|-- build\r\n|-- project\r\n|   |-- src\r\n|   +-- CMakeLists.txt\r\n|-- conanbuildinfo.cmake\r\n+-- conanfile.py\r\n```\r\n\r\nI think I see two solutions. \r\n\r\n1. Create another simple `CMakeLists .txt` to live in the root folder that will import conan and include the `CMakeLists.txt` in `project`.\r\n\r\n2. Move `conanbuildinfo.cmake` to `project/conanbuildinfo.cmake` in the top of the `build` function.\r\n\r\nIs there a more preferred way to do this?"}}
{"actor":{"display_login":"colinbrownec"}}