PengZheng commented on PR #401:
URL: https://github.com/apache/celix/pull/401#issuecomment-1087240555

   IDE integration is essential for Conan-based CBD. Adding a requirement, then 
happily including header and invoking APIs are huge productivity improvement. 
Here I summarized my own Clion setup to facilitate such use cases. Hope that 
will help other developers. @pnoltes 
   
   1. Setup all dependencies using Conan:
   ```
   (conan) peng@hackerlife:~/Downloads/git/mycelix$ conan install . 
celix/2.3.0@zhengpeng/testing -pr:b clang_debug -pr:h clang_debug -if 
cmake-build-debugwithtestsclang/ -o celix:enable_testing=True -o 
celix:enable_address_sanitizer=True -o celix:build_all=True -b missing
   ```
   Here `-pr:b` and `-pr:h` are essential for `tool_requires` in conanfile.py 
to work.
   
   2. Translate all conan options into CMake Cache without actually building:
   ```
   conan build . -bf cmake-build-debugwithtestsclang --configure
   ```
   
   3. Setup Clion CMake profiles properly, special care should be taken to make 
build directory consistent with that in previous steps, i.e. 
cmake-build-debugwithtestsclang.
   
![CMakeSettings](https://user-images.githubusercontent.com/5362947/161499779-1934fc92-e8db-4e40-b982-494d543ecf6e.png)
   
   4. Setup Run/Debug Configurations of the target you want to debug. Special 
care should be taken to setup environment variables properly, otherwise shared 
libraries in Conan cache can not be found. We choose to use `activate_run.sh` 
under the build direcotry.
   
![debug](https://user-images.githubusercontent.com/5362947/161500356-46d0d441-2e84-4b2e-be92-9e636abffe97.png)
   
   5. Happy debugging!
   
![debugging](https://user-images.githubusercontent.com/5362947/161500549-159e3eee-e035-43a3-9624-f32131a8f33e.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to