Re: [CMake] How do I search for personal libraries?
You should find this interesting: http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file In short: * In project A create a AConfig.cmake file and export your targets * In project B call find_package(A REQUIRED) HTH Michael On Wed, Apr 3, 2013 at 7:44 AM, Saad Khattak saadrus...@gmail.com wrote: Hi, Suppose I have two personal repositories: A and B. Repository B has a dependency on repository A i.e. repository A builds multiple libraries and repository B builds multiple libraries and executables. I can build 32-bit and 64-bit libraries/executables for both by having a 'build' and 'buildx64' projects generated by CMake. The libraries and executables are put in the default folders (e.g. repoA/build/src/libraryName/Debug and repoA/buildx64/src/library/Debug). Repo B's executables depend on repo A's libraries and libraries in B. Linking with libraries within B is straightforward as CMake is able to figure out the necessary paths for the libraries B is building which B's executables depend on. Repo B also depends on Repo A's libraries and all executables in B have to search for them. How do I go about this? Currently I am searching for each library by specifying its path: # I have a CACHE variable for the path to Repo A's build folder that the user must provide target_link_libraries(myProject repoAPath/build/src/LibName/${CMAKE_CFG_INTDIR}) which feels like a very wrong way to go about linking with other libraries considering CMake is supposed to make the finding libraries part easier. I would appreciate clarification of the workflow in this case. Thanks, Saad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How do I search for personal libraries?
Thanks Michael. The link is very helpful (although very hard to digest [probably because I am new to CMake] - I have gone over it multiple times now and don't fully understand everything). I will experiment with those commands in my projects. - Saad On Wed, Apr 3, 2013 at 2:52 AM, Michael Wild them...@gmail.com wrote: You should find this interesting: http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file In short: * In project A create a AConfig.cmake file and export your targets * In project B call find_package(A REQUIRED) HTH Michael On Wed, Apr 3, 2013 at 7:44 AM, Saad Khattak saadrus...@gmail.comwrote: Hi, Suppose I have two personal repositories: A and B. Repository B has a dependency on repository A i.e. repository A builds multiple libraries and repository B builds multiple libraries and executables. I can build 32-bit and 64-bit libraries/executables for both by having a 'build' and 'buildx64' projects generated by CMake. The libraries and executables are put in the default folders (e.g. repoA/build/src/libraryName/Debug and repoA/buildx64/src/library/Debug). Repo B's executables depend on repo A's libraries and libraries in B. Linking with libraries within B is straightforward as CMake is able to figure out the necessary paths for the libraries B is building which B's executables depend on. Repo B also depends on Repo A's libraries and all executables in B have to search for them. How do I go about this? Currently I am searching for each library by specifying its path: # I have a CACHE variable for the path to Repo A's build folder that the user must provide target_link_libraries(myProject repoAPath/build/src/LibName/${CMAKE_CFG_INTDIR}) which feels like a very wrong way to go about linking with other libraries considering CMake is supposed to make the finding libraries part easier. I would appreciate clarification of the workflow in this case. Thanks, Saad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] How do I search for personal libraries?
Hi, Suppose I have two personal repositories: A and B. Repository B has a dependency on repository A i.e. repository A builds multiple libraries and repository B builds multiple libraries and executables. I can build 32-bit and 64-bit libraries/executables for both by having a 'build' and 'buildx64' projects generated by CMake. The libraries and executables are put in the default folders (e.g. repoA/build/src/libraryName/Debug and repoA/buildx64/src/library/Debug). Repo B's executables depend on repo A's libraries and libraries in B. Linking with libraries within B is straightforward as CMake is able to figure out the necessary paths for the libraries B is building which B's executables depend on. Repo B also depends on Repo A's libraries and all executables in B have to search for them. How do I go about this? Currently I am searching for each library by specifying its path: # I have a CACHE variable for the path to Repo A's build folder that the user must provide target_link_libraries(myProject repoAPath/build/src/LibName/${CMAKE_CFG_INTDIR}) which feels like a very wrong way to go about linking with other libraries considering CMake is supposed to make the finding libraries part easier. I would appreciate clarification of the workflow in this case. Thanks, Saad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake