[CMake] Various problems deploying a python module

Michael Wild themiwi at gmail.com
Fri Jun 25 12:36:06 EDT 2010


On 25. Jun, 2010, at 17:14 , Janosch Peters wrote:

> On 2010-06-25 16:58:47 +0200, Michael Wild said:
>> However, I think it's really difficult to guarantee consistency. If the code to be compiled contains stuff like the following
>> #ifdef __APPLE__
>> #include <Python/Python.h>
>> #else
>> #include <Python.h>
>> #endif
>> the compiler will compile against the latest framework installation it finds on the search path (probably /System/Library/Frameworks/Python.framework), but for linking whatever CMake (or the user by modifying the cache) chooses to pick will be used, be that the framework installation or some library-installation (Fink, MacPorts, /usr/lib, user-installed, ...).
> 
> AFAIK all directories you give gcc with the "-I" option will be searched _before_ the standard include paths or C_INCLUDE_PATH. So I think you do have control over what is included. But I know almost nohting about all the compiling/linking stuff, so I might be wrong.

The problem is the line

#include <Python/Python.h>

which resolves to /path/to/Python.framework/Headers/Python.h. No way to specify the version, only the framework location using the -F flag.

Michael



More information about the CMake mailing list