[CMake] Confusion regarding usage of find_package and PATHS or HINTS

jmerkow jmerkow at gmail.com
Tue Jun 10 14:28:05 EDT 2014


I'm not the author of the libraries, and none of them are cmake friendly. So
it doesn't make sense to create FOOconfig.cmake files for them. Using the
command line -D  or adding env variables to add new search directories,
seems like an unnecessary headache for the user (our windows users esp
wouldn't enjoy it). Right now, they configure, specify the location of the
externals directory (if it's not in one of the pre-subscribed location) and
the libraries are found.

Some do come with installation packages (commercial libs), but these are
often unused, in favor of placing the libraries in some location. So using
this method allows us to search in the externals directory, search in
default locations, and specify specific locations (full path) to search for
the libraries. I should also mention that many of these libraries have
multiple libs files, not all of which are always needed, and can have
interdependencies between packages. So if I have pacakageA and packageB, I
need different libraries and headers from both packages them if I were to
just have one.  All this logic is obv handled by the main project, and
COMPONENTS arg is used indicate that a particular extra library/header is
needed. 

Essentially, what I'm doing is using the same behavior for finding config
files by adding HINTS/PATHS but looking for libraries instead of
FOOConfig.cmake. 





--
View this message in context: http://cmake.3232098.n2.nabble.com/Confusion-regarding-usage-of-find-package-and-PATHS-or-HINTS-tp7587611p7587620.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list