Hi Kevyn-Alexandre, <br><br>Indeed, you can get or set environment variable from CMake.<br><br>For example:<br> set(ENV{PATH} "/path/to/foo:$ENV{PATH}")<br><br>Hth<br>Jc<br><br><div class="gmail_quote">On Fri, Jul 15, 2011 at 6:02 PM, Kevyn-Alexandre Paré <span dir="ltr"><<a href="mailto:kapare@rogue-research.com">kapare@rogue-research.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">So I could simply get SVN_ROOT_PATH OE_PATH from<br>
<br>
$ENV{SVN_ROOT_PATH}<br>
$ENV{OE_PATH}<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On 2011-07-15, at 5:27 PM, Kevyn-Alexandre Paré wrote:<br>
<br>
> Hi,<br>
><br>
> How do I make cmake to use environment variable?<br>
><br>
> My context is that I want to have environment variable that represent my svn ROOT PATH (developer ENV.) and my open embedded path (in case of cross compiling). What's the best way to have something reusable for each developer?<br>
><br>
><br>
> EX:<br>
><br>
> SOMEWHERE on my HD:<br>
><br>
> SVN_ROOT_PATH<br>
> Project<br>
> trunk<br>
> Config<br>
> Config-Generic-cache.txt #ARCH, COMPILER, FLAGS, build type<br>
> Config-Project-specific-cache.txt # COMPILATION PROJECT SPECIFIC<br>
> CMakeLists.txt<br>
> build<br>
><br>
> SOMEWHERE else on my HD:<br>
> OE_PATH<br>
><br>
> So for now I do this and hardcode the SVN_ROOT_PATH in Config-Generic-cache.txt:<br>
><br>
> cd SVN_ROOT_PATH/Project/trunk/build<br>
> cmake -DCMAKE_SYSTEM_PROCESSOR:STRING=x86_64 -DCMAKE_BUILD_TYPE:STRING=debug -C ../Config/Config-Generic-cache.txt ../<br>
><br>
><br>
> Any suggestion to add the SVN_ROOT_PATH, best solution / best practice?<br>
><br>
> Best Regards<br>
><br>
> Kevyn-Alexandre<br>
><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>
<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><br clear="all"><br>-- <br>+1 919 869 8849<br><br>