Re: [CMake] Can find_package(...) distinguish between debug and release installs?
Hi, Since you're using FetchContent/ExternalProject_Add, you could create a special stage installation folder for those external projects, organize them by different configurations, for example. 3rdParty/Debug/zlib/include+lib 3rdParty/Release/zlib/include+lib So with this way, the name from the external libraries is not that important, we just take care the specific name for specific platform. >From the project needs these libraries, you could set the XXX_ROOT to tell CMake built-in module where to locate the dependency, or locate the include folder and library manually for the different configurations, it would work for both VisualStudio-based project and GCC/Clang projects. Good luck. On Tue, Apr 10, 2018 at 9:59 PM, Saad Khattakwrote: > Thanks Bo. > > I have added the suffix to my libraries already, however with some 3rd > party libraries that I am getting with FetchContent, I have no control over > how they name their libraries. > > Now, their Config.cmake files have release targets that are > globbed by one of the CMake config files (which is part of the install > process). So CMake 'can' figure out which configuration has been installed > and I was hoping that there was a built-in way to distinguish that rather > than me writing some custom scripts for it (where the scripts will search > for the debug/release target files). > > On Mon, Apr 9, 2018 at 11:03 PM Bo Zhou wrote: > >> Hi, >> >> Generally speaking, no, you might have to use the suffix or special name >> to distinguish the different library, such as with the "_d" suffix. >> >> The Boost module of CMake is a considerable example, since it could >> generate different names for Debug and Release libraries on Windows. >> >> At POSIX(UNIX, OSX, Linux), sometimes user mixes the library, it still >> works well. On Windows, it's dangerous or even won't work with mixed >> libraries which were built by different Visual Studios with different >> runtime libraries. >> >> Cheers. >> >> On Tue, Apr 10, 2018 at 10:56 AM, Saad Khattak >> wrote: >> >>> Hi, >>> >>> When find_package(LibA) sets the LibA_FOUND variable, is it possible to >>> know if the package found is the Debug or Release build (or both)? I have a >>> fairly complex build setup where I need to be able to distinguish if >>> find_package(LibA) found a Debug or Release build. >>> >>> - Saad >>> >>> -- >>> >>> Powered by www.kitware.com >>> >>> Please keep messages on-topic and check the CMake FAQ at: >>> http://www.cmake.org/Wiki/CMake_FAQ >>> >>> Kitware offers various services to support the CMake community. For more >>> information on each offering, please visit: >>> >>> CMake Support: http://cmake.org/cmake/help/support.html >>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/ >>> opensource/opensource.html >>> >>> Follow this link to subscribe/unsubscribe: >>> https://cmake.org/mailman/listinfo/cmake >>> >>> >> -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake
Re: [CMake] Can find_package(...) distinguish between debug and release installs?
Thanks Bo. I have added the suffix to my libraries already, however with some 3rd party libraries that I am getting with FetchContent, I have no control over how they name their libraries. Now, their Config.cmake files have release targets that are globbed by one of the CMake config files (which is part of the install process). So CMake 'can' figure out which configuration has been installed and I was hoping that there was a built-in way to distinguish that rather than me writing some custom scripts for it (where the scripts will search for the debug/release target files). On Mon, Apr 9, 2018 at 11:03 PM Bo Zhouwrote: > Hi, > > Generally speaking, no, you might have to use the suffix or special name > to distinguish the different library, such as with the "_d" suffix. > > The Boost module of CMake is a considerable example, since it could > generate different names for Debug and Release libraries on Windows. > > At POSIX(UNIX, OSX, Linux), sometimes user mixes the library, it still > works well. On Windows, it's dangerous or even won't work with mixed > libraries which were built by different Visual Studios with different > runtime libraries. > > Cheers. > > On Tue, Apr 10, 2018 at 10:56 AM, Saad Khattak > wrote: > >> Hi, >> >> When find_package(LibA) sets the LibA_FOUND variable, is it possible to >> know if the package found is the Debug or Release build (or both)? I have a >> fairly complex build setup where I need to be able to distinguish if >> find_package(LibA) found a Debug or Release build. >> >> - Saad >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more >> information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> https://cmake.org/mailman/listinfo/cmake >> >> > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake
Re: [CMake] Can find_package(...) distinguish between debug and release installs?
Hi, Generally speaking, no, you might have to use the suffix or special name to distinguish the different library, such as with the "_d" suffix. The Boost module of CMake is a considerable example, since it could generate different names for Debug and Release libraries on Windows. At POSIX(UNIX, OSX, Linux), sometimes user mixes the library, it still works well. On Windows, it's dangerous or even won't work with mixed libraries which were built by different Visual Studios with different runtime libraries. Cheers. On Tue, Apr 10, 2018 at 10:56 AM, Saad Khattakwrote: > Hi, > > When find_package(LibA) sets the LibA_FOUND variable, is it possible to > know if the package found is the Debug or Release build (or both)? I have a > fairly complex build setup where I need to be able to distinguish if > find_package(LibA) found a Debug or Release build. > > - Saad > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > https://cmake.org/mailman/listinfo/cmake > > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake
[CMake] Can find_package(...) distinguish between debug and release installs?
Hi, When find_package(LibA) sets the LibA_FOUND variable, is it possible to know if the package found is the Debug or Release build (or both)? I have a fairly complex build setup where I need to be able to distinguish if find_package(LibA) found a Debug or Release build. - Saad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake