[CMake] CMAKE_INSTALL_PREFIX problem

Petr Kmoch petr.kmoch at gmail.com
Wed Sep 24 02:58:49 EDT 2014


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 at 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 at 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
>>
>> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140924/1022b3d1/attachment-0001.html>


More information about the CMake mailing list