Hi all,<div><br></div><div>In my project I have a python program (call it program.py) that references a python module also in my project (call it pymodule). program.py gets installed to ${CMAKE_INSTALL_PREFIX}/bin/program and pymodule gets installed to ${PYTHON_INSTALL_DIR}.</div>
<div><br></div><div>To make sure the program.py program always finds pymodule, I treat it like a config script in cmake and then add the following to the top of <a href="http://program.py.in">program.py.in</a>:</div><div>
<br></div><div><div>import sys</div><div>sys.path.append("@PYTHON_INSTALL_DIR@")</div></div><div>import pymodule</div><div><br></div><div>This works great, but it means that I can only run program.py after running a make install, and running it from the installed location.</div>
<div><br></div><div>My question is, is there are clever way of doing this so that I can run program.py from the build directory, without having to install it? (But have it still run properly when installed)</div><div><br>
</div><div>Thanks,</div><div>Kyle</div>