Hi,

Forgive me if this issue has been discussed or is documented elsewhere,
but after some thorough perusal of the archives I didn't find anything.

When using the Xcode generator, is there a way to get find_library() and related
commands to search within the SDK directory specified by CMAKE_OSX_SYSROOT,
rather than the default system path /usr? It would seem to make sense that
if I've specified a target SDK, CMake should search for libraries within
that SDK rather than what is actually installed on my system; I wouldn't want
CMake finding/using a library from my system that doesn't exist in my target 
SDK,
or that is of a different version, etc.

I understand that the Xcode generator employs the -isysroot flag so that at 
compile
and link time paths are searched relative to the specified directory... but I 
don't
believe that has any affect on the search algorithm performed by the find_XXX 
functions
at CMake time. Of course, that does pose a potential problem; if find_library() 
were
to search within the SDK directory and set the corresponding variable to the 
full path
within that directory, but -isysroot were specified in conjuction with the full 
path to
the found library at compile/link time, might that be a problem?

I perused through the various platform files for Darwin and found what looks to 
be
all of the logic for determining the SDK directory, but the directory doesn't 
get
added to any of the likely CMAKE variables that affect the find_XXX functions.
I'm guessing CMAKE_SYSTEM_PREFIX_PATH would be the correct variable to add the 
SDK
directory to.

Of course, maybe I'm thinking about this the wrong way. Either way, I appreciate
whatever help anyone can provide.

Matt
--

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

Reply via email to