[prev in list] [next in list] [prev in thread] [next in thread]
List: cmake
Subject: Re: [CMake] CMAKE_INSTALL_PREFIX problem
From: Jeremy Ardley <jeremy.ardley () gmail ! com>
Date: 2014-09-24 7:02:07
Message-ID: 54226C6F.60008 () gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Thanks for assistance. I forgot 'reply all'. Will be better next time :-)
On 24/09/14 14:58, Petr Kmoch wrote:
> I don't know why @ was inserted, but here's why it overrides the
> absolute path: because it has no special meaning. The path then
> becomes "@/sbin", which is not an absolute path (doesn't start with
> '/'), so the install prefix is prepended normally. Bear in mind that
> Unix directory and file names can contain any characters except '/'
> and NUL.
>
> About variable substitution:
>
> ${var} is the normal way to expand variables.
>
> @var@ is primarily intended for use with configure_file(). I believe
> it works during normal CMake runs as well, but don't use it like that,
> it will only add confusion.
>
> Petr
>
> P.S. Please keep the list in copy when replying.
>
> On Wed, Sep 24, 2014 at 8:45 AM, Jeremy Ardley
> <jeremy.ardley@gmail.com <mailto:jeremy.ardley@gmail.com>> wrote:
>
> It was
>
> set (BUILD_BIN /sbin)
>
> Removing that fixed the problem. Thanks!
>
> Curious why my IDE inserted the '@' (kdevelop 3) And more so why
> it overrides the absolute path?
>
> I need to discover more about value substitution :=(
>
> @somekey@ vs ${somekey}
>
>
> On 24/09/14 14:39, Petr Kmoch wrote:
>> Hi Jeremy.
>>
>> Does ${BUILD_BIN} perhaps start with a slash? If so, it would be
>> interpreted as an absolute path, which of course ignores
>> CMAKE_INSTALL_PREFIX.
>>
>> Petr
>>
>> On Wed, Sep 24, 2014 at 7:58 AM, Jeremy Ardley
>> <jeremy.ardley@gmail.com <mailto:jeremy.ardley@gmail.com>> wrote:
>>
>> I am using cmake 2.8.9 on debian wheezy. I'm fairly new to
>> using cmake.
>>
>> My CMakelists.txt file starts with
>>
>> cmake_minimum_required(VERSION 2.6)
>> SET(CMAKE_INSTALL_PREFIX /home/jeremy/Projects/local/)
>> project(myproject)
>>
>> ....
>>
>> Finishing with
>>
>> INSTALL ( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/@APPLICATION_NAME@ DESTINATION @${BUILD_BIN} )
>>
>> which installs in my target directory, but under a tree
>> prefixed by the '@' character. i.e.
>> /home/jeremy/Projects/local/@/sbin and equivalent.
>>
>> I'm guessing that this is a result of the fragment
>>
>> @${BUILD_BIN}
>>
>> The problem is that if I remove the '@' the INSTALL ignores
>> the CMAKE_INSTALL_PREFIX
>>
>> I've experimented with different variations on the INSTALL
>> lines to no success.
>>
>> Any advice on how to get my INSTALLS ending up in
>> /home/jeremy/Projects/local/sbin and equivalent?
>>
>> Thanks
>>
>> --
>> Jeremy Ardley
>>
>> --
>>
>> Powered by www.kitware.com <http://www.kitware.com>
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake
>> community. For more information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>>
>>
>
>
> --
> Jeremy Ardley
>
>
--
Jeremy Ardley
[Attachment #5 (text/html)]
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Thanks for assistance. I forgot 'reply
all'. Will be better next time :-)<br>
<br>
On 24/09/14 14:58, Petr Kmoch wrote:<br>
</div>
<blockquote
cite="mid:CAKohaZffiyD8my_8u6-U+NBwqRvtxdFWES2CQE0cK8Syc-m+=A@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>I don't know why @ was inserted, but here's why it
overrides the absolute path: because it has no special
meaning. The path then becomes "@/sbin", which is not an
absolute path (doesn't start with '/'), so the install
prefix is prepended normally. Bear in mind that Unix
directory and file names can contain any characters except
'/' and NUL.<br>
<br>
</div>
<div>About variable substitution:<br>
</div>
<div><br>
</div>
${var} is the normal way to expand variables.<br>
<br>
</div>
@var@ is primarily intended for use with configure_file(). I
believe it works during normal CMake runs as well, but don't
use it like that, it will only add confusion.<br>
<br>
Petr<br>
<br>
</div>
P.S. Please keep the list in copy when replying.<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Sep 24, 2014 at 8:45 AM, Jeremy
Ardley <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:jeremy.ardley@gmail.com" \
target="_blank">jeremy.ardley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>It was <br>
<br>
set (BUILD_BIN /sbin)<br>
<br>
Removing that fixed the problem. Thanks!<br>
<br>
Curious why my IDE inserted the '@' (kdevelop 3) And
more so why it overrides the absolute path?<br>
<br>
I need to discover more about value substitution :=(<br>
<br>
@somekey@ vs ${somekey}
<div>
<div class="h5"><br>
<br>
On 24/09/14 14:39, Petr Kmoch wrote:<br>
</div>
</div>
</div>
<div>
<div class="h5">
<blockquote type="cite">
<div dir="ltr">
<div>Hi Jeremy.<br>
<br>
</div>
Does ${BUILD_BIN} perhaps start with a slash? If
so, it would be interpreted as an absolute path,
which of course ignores CMAKE_INSTALL_PREFIX.<br>
<br>
Petr<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Sep 24, 2014 at
7:58 AM, Jeremy Ardley <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:jeremy.ardley@gmail.com"
target="_blank">jeremy.ardley@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> I am
using cmake 2.8.9 on debian wheezy. I'm
fairly new to using cmake.<br>
<br>
My CMakelists.txt file starts with<br>
<br>
cmake_minimum_required(VERSION 2.6)<br>
SET(CMAKE_INSTALL_PREFIX
/home/jeremy/Projects/local/)<br>
project(myproject)<br>
<br>
....<br>
<br>
Finishing with<br>
<br>
<pre>INSTALL ( PROGRAMS \
${CMAKE_CURRENT_BINARY_DIR}/@APPLICATION_NAME@ DESTINATION @${BUILD_BIN} )</pre> \
which installs in my target directory, but under a tree prefixed by the '@' \
character. i.e. /home/jeremy/Projects/local/@/sbin and
equivalent.<br>
<br>
I'm guessing that this is a result of the
fragment <br>
<pre>@${BUILD_BIN}
</pre>
The problem is that if I remove the '@' the
INSTALL ignores the CMAKE_INSTALL_PREFIX<br>
<br>
I've experimented with different variations
on the INSTALL lines to no success.<br>
<br>
Any advice on how to get my INSTALLS ending
up in /home/jeremy/Projects/local/sbin and
equivalent?<br>
<br>
Thanks<span><font color="#888888"><br>
<br>
<div>-- <br>
<font size="4"> <font
color="DarkCyan">Jeremy Ardley</font><br>
</font></div>
</font></span></div>
<br>
--<br>
<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com"
target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the
CMake FAQ at: <a moz-do-not-send="true"
href="http://www.cmake.org/Wiki/CMake_FAQ"
\
target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br> <br>
Kitware offers various services to support the
CMake community. For more information on each
offering, please visit:<br>
<br>
CMake Support: <a moz-do-not-send="true"
href="http://cmake.org/cmake/help/support.html"
\
target="_blank">http://cmake.org/cmake/help/support.html</a><br> CMake Consulting: \
<a moz-do-not-send="true"
href="http://cmake.org/cmake/help/consulting.html"
\
target="_blank">http://cmake.org/cmake/help/consulting.html</a><br> CMake Training \
Courses: <a moz-do-not-send="true"
href="http://cmake.org/cmake/help/training.html"
\
target="_blank">http://cmake.org/cmake/help/training.html</a><br> <br>
Visit other Kitware open-source projects at <a
moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
\
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/cmake"
\
target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br> \
</blockquote> </div>
<br>
</div>
</blockquote>
<br>
<br>
</div>
</div>
<span class="HOEnZb"><font color="#888888">
<div>-- <br>
<font size="4"> <font color="DarkCyan">Jeremy
Ardley</font><br>
</font></div>
</font></span></div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<font size="4">
<font color="DarkCyan">Jeremy Ardley</font><br>
</font></div>
</body>
</html>
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic