Yeah I already knew about CMAKE_MODULE_PATH, however I had forgotten that cmake modules are merely put in-place and then executed. So, CMAKE_MODULE_PATH seems to be the only choice here.<div><br></div><div>The most annoying thing about this solution, though, is that every single CMakeLists.txt that includes this module needs to make sure it has CMAKE_MODULE_PATH setup properly. It's just a bit redundant and tedious.<br>
<div><br></div><div>Thanks for the help guys.<br><br><div class="gmail_quote">On Thu, May 28, 2009 at 2:43 AM, Marcel Loose <span dir="ltr"><<a href="mailto:loose@astron.nl">loose@astron.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hmm,<br>
<br>
I guess the original question referred to cmake modules (at least that's<br>
what I figured from the file names). Have you tried to set<br>
CMAKE_MODULE_PATH. Then you don't need any relative paths anymore.<br>
<br>
Best regards,<br>
<font color="#888888">Marcel Loose.<br>
</font><div><div></div><div class="h5"><br>
-----Original Message-----<br>
From: Adolfo Rodríguez <<a href="mailto:dofo79@gmail.com">dofo79@gmail.com</a>><br>
To: Tyler Roscoe <<a href="mailto:tyler@cryptio.net">tyler@cryptio.net</a>><br>
Cc: cmake <<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>><br>
Subject: Re: [CMake] Relative include() calls<br>
Date: Thu, 28 May 2009 09:36:33 +0200<br>
<br>
<br>
<br>
On Thu, May 28, 2009 at 7:16 AM, Tyler Roscoe <<a href="mailto:tyler@cryptio.net">tyler@cryptio.net</a>> wrote:<br>
On Wed, May 27, 2009 at 11:27:28PM -0500, Robert Dailey wrote:<br>
> From a CMakeLists.txt in my root source dir, I am calling:<br>
> include( ../cmake/common.cmake )<br>
><br>
> From common.cmake, I am calling:<br>
><br>
> include( BoostUtils.cmake )<br>
><br>
> BoostUtils.cmake and common.cmake are side-by-side in the same<br>
directory on<br>
> Windows. The second call to include() fails, because the<br>
working directory<br>
> is still set to the directory of the CMakeLists.txt, when I<br>
expect the<br>
<br>
<br>
This is the behavior I would expect. include() is a lot like<br>
#include<br>
(or :r in vi); it's as though the contents of the included file<br>
were<br>
dropped into the middle of your CMakeLists.<br>
<br>
Ergo, I would write:<br>
<br>
> include( ../cmake/BoostUtils.cmake )<br>
<br>
have you tried using CMAKE_CURRENT_SOURCE_DIR or CMAKE_CURRENT_LIST_FILE<br>
+extracting the path, i.e.,<br>
<br>
include( ${CMAKE_CURRENT_SOURCE_DIR}/BoostUtils.cmake )<br>
<br>
<br>
<br>
<br>
<br>
If you don't want to write ../cmake all the time, I'm pretty<br>
sure<br>
there's a variable that controls where CMake will look for<br>
things to<br>
include().<br>
<br>
tyler<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at:<br>
<a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
<br>
<br>
--<br>
Adolfo Rodríguez Tsouroukdissian<br>
<br>
Robotics engineer<br>
PAL ROBOTICS S.L<br>
<a href="http://www.pal-robotics.com" target="_blank">http://www.pal-robotics.com</a><br>
Tel. +34.93.414.53.47<br>
Fax.+34.93.209.11.09<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div></div>