diff --git a/README.md b/README.md index 8e88aa8c9c6ff251f66781ae27fe4e63609b8f77..124f82cbc8f92050703592733adee849871bbff0 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,7 @@ catkin workspace. # How it's done [cmake-conan](https://github.com/conan-io/cmake-conan) is used to activate -conan during the cmake build process. It then installs the dependencies from -the conanfile.txt and uses the cmake_find_package generator to generate the -findXXX.cmake files. Those targets can be found via find_package() and later -be linked with the targets. +conan during the cmake build process to install and find the dependencies. Building with conan requires to define the build type: ``` bash @@ -22,6 +19,29 @@ Also note that the workspace will be a mixed catkin and cmake workspace. So only Since catkin libraries will be built as position independent shared libraries by default, use the `*:shared=True` and `*.fPIC=True` options in conanfile.txt. +# Using cmake_find_package generator +This is what is shown here. The cmake_find_package generator to generate the +findXXX.cmake files. Conan does not modify the CMAKE_PREFIX_PATH which would +disturb the catkin build process. Those targets can be found via find_package() +and later be linked with the built targets. + +# Using cmake generator +This is not shown here but I found a way to make it work. Place the following +cide between catkin_package(...) and your first target defenition: + +```cmake +if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") +message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") +file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.13/conan.cmake" + "${CMAKE_BINARY_DIR}/conan.cmake") +endif() +include(${CMAKE_BINARY_DIR}/conan.cmake) +conan_cmake_run(CONANFILE conanfile.txt +BASIC_SETUP +BUILD missing) +``` + +Then link the targets with ```${CONAN_LIBS}```. # Requirements Setup the following conan repositories: