<div>Q: What is the appropriate way of doing this?<br>A: Not sure about &quot;appropriate&quot;, but here&#39;s one way that I achieve that goal... :-)<br><br>SET(MY_OWN_INSTALL_PREFIX &quot;/usr/thispkg&quot; CACHE PATH &quot;Prefix prepended to install directories&quot;)
<br></div><span class="sg"><div>SET(CMAKE_INSTALL_PREFIX &quot;${MY_OWN_INSTALL_PREFIX}&quot; CACHE INTERNAL &quot;Prefix prepended to install directories&quot; FORCE)<br>

<span class="sg"><div><br>That way, you have a cache variable that CMake knows nothing about (and hence, has no default value for it) that you are in charge of priming, but that the user can still change through the ccmake/CMakeSetup guis... that always gets propagated into CMAKE_INSTALL_PREFIX because of the FORCE. (And gets hidden from the guis because of the INTERNAL.)
<br><br>Of course, the FORCE means you cannot override via -DCMAKE_INSTALL_PREFIX, but you could still override via -DMY_OWN_INSTALL_PREFIX.<br></div></span></div></span><br><br>HTH,<br>David<br><br><br><div><span class="gmail_quote">
On 8/11/07, <b class="gmail_sendername">Lee Butler</b> &lt;<a href="mailto:iraytrace@mac.com">iraytrace@mac.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">Is there a way to override CMAKE_INSTALL_PREFIX in a multi-level CMake project?&nbsp; Since my package has a long history of being installed in a location other than /usr/local, I really want to have the default match previous practice.
<div><br></div><div>For example, I have a source tree that looks like this:<div><br></div><div>root_dir</div><div>&nbsp;&nbsp; &nbsp;src</div><div>&nbsp;&nbsp; &nbsp;lib</div><div><br></div><div>In the root_dir/CMakeLists.txt file I set:</div><div><br>
</div><div>SET(CMAKE_INSTALL_PREFIX &quot;/usr/thispkg&quot; CACHE PATH &quot;Prefix prepended to install directories&quot;)</div><div><br></div><div>However this default setting does not show up when running ccmake or cmake.
</div><div><br></div><div><font face="Courier" size="3"><span style="font-size: 13px;">Changing this to:</span></font></div><div><font face="Courier" size="3"><span style="font-size: 13px;"><br></span></font></div><div><font face="Courier" size="3">
<span style="font-size: 13px;">SET(CMAKE_INSTALL_PREFIX &quot;/usr/thispkg&quot;)</span></font></div><div><font face="Courier" size="3"><span style="font-size: 13px;"><br></span></font></div><div><font face="Courier" size="3">
<span style="font-size: 13px;">causes the value to show up in the root&nbsp;<font face="Helvetica" size="3"><span style="font-size: 12px;">cmake_install.cmake file but nowhere else.</span></font></span></font></div><div><br></div>
<div>What is the appropriate way of doing this?</div><span class="sg"><div><br></div><div>Lee Butler</div></span></div></div><br>_______________________________________________<br>CMake mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:CMake@cmake.org">
CMake@cmake.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>