Hi all,<br><br>I have a project which provides a set of shared libraries, some libraries being dependent on other ones:<br><br>For example:<br>libcore<br>libmodule1 -> libcore<br>libmodule2 -> libcore<br>libmoduleA -> libmodule1<br>
<br>As this is a CMake based project, I've read on the internet that I should provide a ProjectConfig.cmake file to allow other CMake based projects to use the libraries. So I tried to do that after reading the tutorial on the CMake's wiki and I have a working ProjectConfig.cmake for an installed tree which contains all the targets (I did not succeed to have it working for an in build tree though).<br>
<br>The problem is that I want each of my libraries to be "self-supported" (for example, I'd like to use find_package() in module1 to find core). I want to be able to have different version for each library which depends on specific versions of the other libraries. If I am correct, that means I need to generate one ProjectConfig.cmake and one ProjectConfigVersion.cmake for each library.<br>
<br>This way, I should be able to create a project which does find_package(core 1.3) and find_package(module2 0.3) if it needs only the module2. But the Module2Config.cmake tries do redeclare the "core" imported target which is already created by the CoreConfig.cmake. Indeed I already have this problem directly in the Module2's CMakeLists.txt as I tried to find_package(core 1.3) here in order to define the include directories and to link to the core.<br>
<br>If I try to not export "core" when generating Module2Config.cmake, I get an error telling me that "module2" depends on "core" so it must be exported.<br><br>So, to sum it up, I'd like each "module" to find its dependencies as if it was third party libraries (installed tree and in build tree must be supported). Then, everything should be ok to create a project which uses only a few of the modules.<br>
<br>Any hints?<br><br>